System.Net.Http Namespace
Provides classes for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. This namespace is fundamental for building web-connected applications in .NET, enabling scenarios like consuming RESTful APIs, web scraping, and interacting with web services.
Classes
Provides a base class for sending HTTP requests and receiving HTTP responses from a Uri.
Summary:
- The primary class for performing HTTP operations.
- Supports sending requests asynchronously.
- Manages connections efficiently.
See Also:
Provides a default implementation of the HttpMessageHandler class.
Summary:
- Configures behavior for HTTP requests, such as proxies, cookies, and credentials.
- Can be used to customize `HttpClient`'s request processing.
Represents an HTTP request message.
Summary:
- Encapsulates all information needed to send an HTTP request.
- Includes method (GET, POST, etc.), URI, headers, and content.
Represents a message that is sent to an HTTP server as part of a request.
Summary:
- Represents an HTTP response received from a server.
- Includes status code, headers, and response content.
A base class representing HTTP content, such as an HTTP message body.
Summary:
- Abstract base class for HTTP request and response content.
- Provides methods for reading and writing content.
- Concrete implementations include `StringContent`, `ByteArrayContent`, `StreamContent`, and `FormUrlEncodedContent`.
Represents an HTTP String content.
Summary:
- A concrete implementation of
HttpContent
for string data. - Allows specifying encoding and media type.
Represents form-urlencoded content.
Summary:
- Used for submitting form data in `application/x-www-form-urlencoded` format.
- Takes a collection of key-value pairs.
Structs
Specifies when an operation completes.
Summary:
- Defines values like
ResponseContentRead
andResponseHeadersRead
. - Controls when an asynchronous HTTP operation is considered complete.
Interfaces
Provides an abstract base class for sending HTTP messages.
Summary:
- Represents a mechanism for sending HTTP requests.
HttpClient
uses instances of this class to send requests.