title: NestJS HttpService call multiple endpoints
body: <p>I'm usually a PHP developer with almost no experience with javascript/typescript. Just started using NestJS - I want to have an endpoint that returns a list of <code>requisitions</code> that was retrieved from another system via its endpoint. </p>
  
  <p>The rough idea:</p>
  
  <ol>
  <li>Call the login endpoint with credentials</li>
  <li>Call the <code>requisition</code> listing endpoint with the token from the login endpoint</li>
  <li>Return the result</li>
  </ol>
  
  <p>I have experimented around with calling an endpoint like so:</p>
  
  <pre class="lang-js prettyprint-override"><code>const url ='https://the-requisition-endpoint';
  const config: AxiosRequestConfig = {
        headers: {
          'Accept': 'application/json',
          'Authorization': 'a_hard_coded_token_string' // hard coded for experimentation
        }
      };
  let result = this.httpService.get(url, config);
  result.subscribe(response =&gt;
    console.log(response.data);
  });
  
  </code></pre>
  
  <p>Now I need to change it so that the token is not hardcoded - to use the token from the login endpoint.</p>
  
  <p>I'm not sure how to force the requisition endpoint to only be called once the login endpoint returns the token. I've searched and found that either a <code>Promise.all()</code> or <a href="https://stackoverflow.com/questions/35608025/promise-all-behavior-with-rxjs-observables">a function called <code>zip</code> might help</a>,
  but I don't know how to make it work.</p>