System.Net.Http Namespace

The System.Net.Http namespace provides a programming interface for modern HTTP applications.

Remarks

The System.Net.Http namespace is designed to provide the following:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

The System.Net.Http namespace and the related System.Net.Http.Headers namespace provide the following set of components:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

There are various HTTP message handles that can be used. These include the following.

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

The contents of an HTTP message corresponds to the entity body defined in RFC 2616.

A number of classes can be used for HTTP content. These include the following.

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

If an app using the System.Net.Http and System.Net.Http.Headers namespaces intends to download large amounts of data (50 megabytes or more), then the app should stream those downloads and not use the default buffering. If the default buffering is used the client memory usage will get very large, potentially resulting in substantially reduced performance.

Classes in the System.Net.Http and System.Net.Http.Headers namespaces can be used to develop Windows Store apps or desktop apps. When used in a Windows Store app, classes in the System.Net.Http and System.Net.Http.Headers namespaces are affected by network isolation feature, part of the application security model used by the win8. The appropriate network capabilities must be enabled in the app manifest for a Windows Store app for the system to allow network access by a Windows store app. For more information, see the Network Isolation for Windows Store Apps.

Classes

TypeReason
ByteArrayContent

Provides HTTP content based on a byte array.

ClientCertificateOption

Specifies how client certificates are provided.

DelegatingHandler

A type for HTTP handlers that delegate the processing of HTTP response messages to another handler, called the inner handler.

FormUrlEncodedContent

A container for name/value tuples encoded using application/x-www-form-urlencoded MIME type.

HttpClient

Provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI.

HttpClientHandler

The default message handler used by HttpClient.

HttpCompletionOption

Indicates if HttpClient operations should be considered completed either as soon as a response is available, or after reading the entire response message including the content.

HttpContent

A base class representing an HTTP entity body and content headers.

HttpMessageHandler

A base type for HTTP message handlers.

HttpMessageInvoker

A specialty class that allows applications to call the HttpMessageInvoker.SendAsync(HttpRequestMessage,CancellationToken) method on an Http handler chain.

HttpMethod

A helper class for retrieving and comparing standard HTTP methods and for creating new HTTP methods.

HttpRequestException

A base class for exceptions thrown by the HttpClient and HttpMessageHandler classes.

HttpRequestMessage

Represents a HTTP request message.

HttpResponseMessage

Represents a HTTP response message including the status code and data.

MessageProcessingHandler

A base type for handlers which only do some small processing of request and/or response messages.

MultipartContent

Provides a collection of HttpContent objects that get serialized using the multipart/* content type specification.

MultipartFormDataContent

Provides a container for content encoded using multipart/form-data MIME type.

StreamContent

Provides HTTP content based on a stream.

StringContent

Provides HTTP content based on a string.