title: Nodejs Request Promise How to display status code
body: <p>I am using the request library to make external api calls. <a href="https://github.com/request/request" rel="noreferrer">https://github.com/request/request</a>. I am using the native promise/async extention. <a href="https://github.com/request/request-promise-native" rel="noreferrer">https://github.com/request/request-promise-native</a>.</p>
  
  <p>However I am not able to check the status code, it is undefined.</p>
  
  <pre><code>public async session(): Promise&lt;any&gt; {
  
      const url = &lt;removed&gt;;
  
      const options = {
  
          uri: url,
          headers: {
              'Authorization': this.config.token
          },
          json: true,
          body: {
          }
      }
  
      try {
          const res = await request.post(options);
  
          if (res.statusCode !== 200) {
              // do something
          }
          console.log(res);
          console.log("statuscode", res.statusCode)
          return res;
      } catch (err) {
          return err;
      }
  }
  </code></pre>
  
  <p>The res.statusCode is undefined.</p>