As far as I know, in HTTP 1.1 you can use the same TCP/IP connection for multiple requests, but you can't execute more than one request at a time on that connection. In other words, it has to go like: Request, Response, Request, Response, Request, .... You can't do something like: Req1, Req2, Resp1, Req3, Resp3, Resp2. Maybe you can with HTTP/2, I don't know.
Anyway, my question is: what happens if you try to send multiple simultaneous requests with FlurlClient?
Like:
using (var client = new FlurlClient("https://api.com"))
{
var req1Task = client.Request("path1").PostJsonAsync(thing);
var req2Task = client.Request("path2").GetAsync();
await Task.WhenAll(req1Task, req2Task);
// Do something with responses.
}
I know the answer for HttpClient.
The answer is that if you try to start another request on HttpClient when a request is already pending, HttpClient will create a new TCP/IP connection. Whereas if you had waited until the first request was done, HttpClient would reuse the connection for the 2nd request.
My guess is that FlurlClient is the same.