Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What assembly is HttpClient stored in

Tags:

rest

c#

wcf

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.

like image 753
scope_creep Avatar asked Oct 15 '11 15:10

scope_creep


People also ask

What is the namespace for HttpClient?

The HttpClient class resides on the System. Net. Http namespace, which is a brand new . NET 4.5 namespace.

Does HttpClient need to be disposed C#?

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.

What is HttpClient in API?

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.


1 Answers

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.

like image 189
driis Avatar answered Oct 02 '22 12:10

driis