title: How to use axios HttpService from Nest.js to make a POST request
body: <p>I am trying to make a POST request using <code>@nestjs/axios</code> and return the response.</p>
  <p>This is my code:</p>
  <pre><code>verifyResponse(captcha_response: String): Observable&lt;AxiosResponse&lt;any&gt;&gt; {
  
      return this.httpService.post('&lt;url of rest endpoint to verify captcha&gt;', {
          captcha_response
      });
  }
  </code></pre>
  <p>However, Visual Studio Code says <code>Cannot find name 'AxiosResponse'</code>. Where can I import this from? This type was used in the <a href="https://docs.nestjs.com/techniques/http-module#getting-started" rel="noreferrer">Nest.js docs</a> as <code>Observable&lt;AxiosResponse&lt;Cat[]&gt;&gt;</code>. I decided to remove this and just use the type <code>Observable&lt;any&gt;</code>.</p>
  <p><strong>This works.</strong> However, if I use <code>console.log()</code> to view the response I get this:</p>
  <pre><code>Observable { _subscribe: [Function (anonymous)] }
  </code></pre>
  <p>Most answers I found on StackOverflow suggest to use some variation of this:</p>
  <pre><code>return this.httpService.post('&lt;url of rest endpoint to verify captcha&gt;', {
          captcha_response
      }).pipe(map(response =&gt; response.data));
  </code></pre>
  <p>...but <code>console.log()</code> gives me this:</p>
  <pre><code>Observable {
    source: Observable { _subscribe: [Function (anonymous)] },
    operator: [Function (anonymous)]
  }
  </code></pre>
  <p>Some other answers on StackOverflow suggest to use <code>.toPromise()</code>, but apparently this is deprecated.</p>
  <p>All in all, I'm new to Nest.js and I'm super confused. Since I can't find one, I would be really grateful for a complete and up-to-date example of how to make a simple POST request and return the response as JSON.</p>