title: Node.js: Getting the response body from a POST request
body: <p>I'm having trouble extracting the response body of a POST request in Node.js.I'm expecting the RESPONSE: 'access_token=...'</p>
  
  <p>Should be pretty simple, not sure what I should be doing though. (Node v0.4.3)</p>
  
  <p>Here's my code snippet. </p>
  
  <pre><code>payload = 'client_id='+client_id + '&amp;client_secret='+ client_secret
                                    + '&amp;code='+ code
     var options = {
        host: 'github.com',
        path: '/login/oauth/access_token?',
        method: 'POST'
     };
  
     var access_req = https.request(options, function(response){
        response.on('error', function(err){
           console.log("Error: " + err);
        });
        // response.body is undefined
        console.log(response.statusCode);
     });
  
     access_req.write(payload);
     access_req.end();
     console.log("Sent the payload " + payload + "\n");
     res.send("(Hopefully) Posted access exchange to github");
  </code></pre>