title: how to get http response from typescript post
body: <p>I have tried looking at other questions but they dont seem to help. I have the following method in typescript</p>
  
  <pre><code>transferAmount(transfer: Transfer): Observable&lt;number&gt; {
  return this.http
    .post&lt;number&gt;(
      `${this._baseUrl}:8092/api/transfers/`,
      transfer,
      { observe: "response" }
    )
    .pipe(
      mergeMap((response: any) =&gt; {
        console.log(response.json());
        const location = `${response.headers.get("Location")}`;
        console.log(parseInt(location.slice(location.lastIndexOf("/") + 1)))
        return of(parseInt(location.slice(location.lastIndexOf("/") + 1)));
      })
    );
  </code></pre>
  
  <p>}</p>
  
  <p>I have tried to log the response using </p>
  
  <pre><code>console.log(response.json()) 
  </code></pre>
  
  <p>but this does not work?</p>