title: Run multiple WebRequest in parallel in asp.net core
body: <p>I have the following situation. I want to execute 6 URL request (each request is with different auth_token and returns different data ). Here is the function that is making requests for different auth_token.</p>
  <pre><code> private static async Task&lt;List&lt;Positions&gt;&gt; GeneratePositions(string auth_token)
          {
              var request = WebRequest.Create(www.some_url.com);
  
              request.Headers.Add(&quot;authorization&quot;, &quot;Bearer &quot; + auth_token);
              request.Method = &quot;GET&quot;;
  
              WebResponse response = null;
  
              try
              {
                  response = await request.GetResponseAsync();
              }
              catch (Exception ex)
              {
                  // TODO log
                  throw ex;
              }
  
              var dataStreamRes = response.GetResponseStream();
              var reader = new StreamReader(dataStreamRes);
              var buffResponse = await reader.ReadToEndAsync();
  
              var positions = JsonSerializer.Deserialize&lt;List&lt;Positions&gt;&gt;(buffResponse);
  
              reader.Close();
              dataStreamRes.Close();
              response.Close();
  
              return positions;
          }
  </code></pre>
  <p>This function is ran using <code>await</code>  operator. But the problem is that every requests waits for the previous one to start.
  Do you have any idea how I can run multiple requests for multiple auth_tokens at the same time, without waiting the previous one to finish, and of course collect the data returned.</p>