Both of them fulfill the same goal.
HttpWebRequest / HttpWebResponse available since the first version of .NET and is still an absolutely correct approach.HttpClient (which uses HttpRequestMessage and HttpResponseMessage to represent requests and responses) was introduced in .NET 4.5 and offers a completely asynchronous API, as well as a new model for request and response content; internally, it still relies on HttpWebRequest / HttpWebResponse .
An important difference is that HttpWebRequest/Response presents a request and response only from the client's point of view, while HttpRequestMessage/HttpResponseMessage can be used either by the client or by the server (ASP.NET Web API uses these types to communicate with the client).
You can use the one you like best; just keep in mind that since HttpClient is asynchronous, the code that uses it must also be asynchronous.
Thomas levesque
source share