title: How to check for an empty response body in Angular2's http.response?
body: <p>I want to check if my response has content in the body.  I would have thought that res.totalBytes would do it, but it is always undefined.</p>
  
  <pre><code>this.http.get(this.url, this.options)
      .toPromise()
      .then( (res) =&gt; {
          console.log("totalBytes: "+res.totalBytes);//outputs 'totalBytes: undefined'
          console.log("res body: "+JSON.stringify(res.json()));//outputs a great big JSON object just as I would expect.
          });
  </code></pre>
  
  <p>What's the best way to check if the body is empty (ideally without relying on an exception being thrown), and why is totalBytes always undefined even when the body has a great big object in it? </p>