Using async await to get http response from request.post
<p>I am writing a server in node using async/await (<a href="http://stackabuse.com/node-js-async-await-in-es7/" rel="nofollow">http://stackabuse.com/node-js-async-await-in-es7/</a> and using bable to transpile)  and request (<a href="https://github.com/request/request" rel="nofollow">https://github.com/request/request</a>). I am trying to make a post request to an external api and access the http response headers. I can only figure out how to access the request that I am sending. How do I get the HttpResponse?</p>

<p>Here is the code</p>

<pre><code>var options = {
  url: externalUrl,
  form: body
};

try {
  var httpResponse = await request.post(options);
  console.log(httpResponse.headers.location);
  return "post request succeeded!";
} catch (err) {
  return done(err, null);
}
</code></pre>