title: Getting a full response in Angular http Post request
body: <p>I am trying to get full response from a POST request. I have read how to get full response for a get request mentioned at the official site of angular.
  <a href="https://angular.io/guide/http" rel="noreferrer">Angular http</a></p>
  
  <p>What it says is to add  <code>{ observe: 'response' }</code>. But it would work for a <code>get</code> request and not for <code>post</code> request. <code>post</code> request accepts 2-3 arguments, so I cannot send this as the 4th argument. Please have a look at my code and let me know what I am doing wrong.</p>
  
  <pre><code>    const httpOptions = {
          headers: new HttpHeaders({
            'Content-Type':  'application/json'
          })
      };
  
      return this.http.post('http://localhost:3000/api/Users/login', data, httpOptions, { observe: 'response' })
          .do( function(resp) {
              self.setSession(resp);
          });
  </code></pre>
  
  <p>This gives me an error as 4 arguments are not allowed.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>The accepted answer seems to be not working now. I am getting the following </p>
  
  <pre><code>error:
  error TS2345: Argument of type '{ headers: HttpHeaders; observe: string; }' is not assignable to parameter of type '{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: Ht...'.
    Types of property 'observe' are incompatible.
      Type 'string' is not assignable to type '"body"'.
  </code></pre>