title: How can I get the raw HTTP message body using the request library in Node.js?
body: <p>The <a href="https://www.npmjs.com/package/request" rel="noreferrer">npm-request</a> library allows me to construct HTTP requests using a nice JSON-style syntax, like this.</p>
  
  <pre><code>request.post(
      {
          url: 'https://my.own.service/api/route',
          formData: {
              firstName: 'John',
              lastName: 'Smith'
          }
      },
      (err, response, body) =&gt; {
          console.log(body)
      }
  );
  </code></pre>
  
  <p>But for troubleshooting, I really need to see the HTTP message body of the <strong>request</strong> as it would appear on the wire. Ideally I'm looking for a raw bytes representation with a Node.js <code>Buffer</code> object. It seems easy to get this for the response, but not the request. I'm particularly interested in <code>multipart/form-data</code>.</p>
  
  <p>I've looked through the documentation and GitHub issues and can't figure it out.</p>