Demystifying HttpClient Internals: HttpRequestMessage

added by DotNetKicks
3/20/2019 12:09:26 AM

2 Kicks, 451 Views

Anyone who regularly works with HttpClient will have likely have also used the HttpRequestMessage class. While HttpClient supports some convenience methods for quick actions such as sending a GET request; once you have more complex requirements, such a needing to include headers on the request, you will need to use HttpClient.SendAsync which accepts a HttpRequestMessage.