I want to use the HttpClient
class from the WCF Rest Service to create a client to call rest
services. I heard it was rolled into .net 4.0 but don't know the assembly it's stored in.
The HttpClient class resides on the System. Net. Http namespace, which is a brand new . NET 4.5 namespace.
There is no need to dispose of the HttpClient instances from HttpClientFactory. Disposal will not actually do anything in this case because the factory manages the handler and connection lifetimes and not the HttpClient instances.
An HttpClient can be used to send requests and retrieve their responses. An HttpClient is created through a builder . The builder can be used to configure per-client state, like: the preferred protocol version ( HTTP/1.1 or HTTP/2 ), whether to follow redirects, a proxy, an authenticator, etc.
According to this MSDN page, it is new in .NET 4.5.
"Supported in: 4.5"
If you're on .NET 4.5, it will be in the System.Net.Http assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With