title: making two fetch requests in one function with a delay in between
body: <p>so I have 2 endpoints, I'm making a "post" request to the first one and in the response I should get some kind of id that I use in the second request endpoint url. so I want to make a delay or something till I get the response from the first request.</p>
  
  <pre><code>req = () =&gt; {
    fetch('url', {
        method: 'POST',
        headers: {
          'Authorization': bearer,
          'Content-Type': 'application/json',
        },
        body: 
      })
      .then(response =&gt; response.json())
      .then(json =&gt; {
  
      })
    fetch(`url with the id I get from the first request`, {
        method: 'GET',
        headers: {
          'Authorization': bearer,
          'Content-Type': 'application/json',
        }
      })
      .then(response =&gt; response.json())
      .then(json =&gt; {
  
      })
  }
  </code></pre>