title: Angular HttpClient can't get response body message
body: <p>I am planning using <a href="https://angular.io/guide/http" rel="nofollow noreferrer">HttpClient</a> post to my getFeedback endpoint and get response and show it in my app. 
  I have one codeService and one dashboard component, This is the code for post in my code service:</p>
  
  <pre><code>     //method 1
   async generateFeedbackPost() {
          var headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded');
          var body = new URLSearchParams();
          body.set('code', this.code);
          return this.http.post(this.url, body.toString(), { headers }).toPromise();
      }
      //method 2
  generateFeedbackPost2() {
      var headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded');
      var body = new URLSearchParams();
      body.set('code', this.code);
      return this.http.post(url, body.toString(), {headers});
  }
  </code></pre>
  
  <p>In my dashboard component I call these methods:</p>
  
  <pre><code>this.codeService.generateFeedbackPost2().subscribe(data =&gt; {console.log(data);});
  this.codeService.generateFeedbackPost().then(data =&gt; {console.log(data);});
  </code></pre>
  
  <p>I have tried these two ways, however, both of them print null in console. however, in my chrome developer tools network tab, I can exactly see the results:</p>
  
  <p><a href="https://i.stack.imgur.com/AF6Hr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AF6Hr.png" alt="enter image description here"></a></p>
  
  <p>Do you know how to retrieve these messages back? </p>