Closed
Description
Currently, RestSharp uses HttpWebRequest
, since that was the "way to do it" back in the days.
Time passed by and HttpClient
dominates now, so we need to move on.
There are several issues with HttpWebRequest
implementation that could be resolved by using HttpClient
:
- Use proper async flow with cancellation and context
- Use a single instance of
HttpClient
for connection pooling - Support HTTP2
These are the main issues but there're advantages that overall come with more modern implementation.
In the latest versions of .NET framework (full and core), HttpWebRequest
uses the HttpClient
anyway.