HttpListenerRequest Class
Describes an incoming HTTP request to an HttpListener object. This class cannot be inherited.
Assembly: System (in System.dll)
The HttpListenerRequest type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | AcceptTypes | Gets the MIME types accepted by the client. |
![]() | ClientCertificateError | Gets an error code that identifies a problem with the X509Certificate provided by the client. |
![]() | ContentEncoding | Gets the content encoding that can be used with data sent with the request |
![]() | ContentLength64 | Gets the length of the body data included in the request. |
![]() | ContentType | Gets the MIME type of the body data included in the request. |
![]() | Cookies | Gets the cookies sent with the request. |
![]() | HasEntityBody | Gets a Boolean value that indicates whether the request has associated body data. |
![]() | Headers | Gets the collection of header name/value pairs sent in the request. |
![]() | HttpMethod | Gets the HTTP method specified by the client. |
![]() | InputStream | Gets a stream that contains the body data sent by the client. |
![]() | IsAuthenticated | Gets a Boolean value that indicates whether the client sending this request is authenticated. |
![]() | IsLocal | Gets a Boolean value that indicates whether the request is sent from the local computer. |
![]() | IsSecureConnection | Gets a Boolean value that indicates whether the TCP connection used to send the request is using the Secure Sockets Layer (SSL) protocol. |
![]() | KeepAlive | Gets a Boolean value that indicates whether the client requests a persistent connection. |
![]() | LocalEndPoint | Get the server IP address and port number to which the request is directed. |
![]() | ProtocolVersion | Gets the HTTP version used by the requesting client. |
![]() | QueryString | Gets the query string included in the request. |
![]() | RawUrl | Gets the URL information (without the host and port) requested by the client. |
![]() | RemoteEndPoint | Gets the client IP address and port number from which the request originated. |
![]() | RequestTraceIdentifier | Gets the request identifier of the incoming HTTP request. |
![]() | ServiceName | Gets the Service Provider Name (SPN) that the client sent on the request. |
![]() | TransportContext | Gets the TransportContext for the client request. |
![]() | Url | Gets the Uri object requested by the client. |
![]() | UrlReferrer | Gets the Uniform Resource Identifier (URI) of the resource that referred the client to the server. |
![]() | UserAgent | Gets the user agent presented by the client. |
![]() | UserHostAddress | Gets the server IP address and port number to which the request is directed. |
![]() | UserHostName | Gets the DNS name and, if provided, the port number specified by the client. |
![]() | UserLanguages | Gets the natural languages that are preferred for the response. |
| Name | Description | |
|---|---|---|
![]() | BeginGetClientCertificate | Begins an asynchronous request for the client's X.509 v.3 certificate. |
![]() | EndGetClientCertificate | Ends an asynchronous request for the client's X.509 v.3 certificate. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetClientCertificate | Retrieves the client's X.509 v.3 certificate. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
When a client makes a request to a Uniform Resource Identifier (URI) handled by an HttpListener object, the HttpListener provides a HttpListenerContext object that contains information about the sender, the request, and the response that is sent to the client. The HttpListenerContext::Request property returns the HttpListenerRequest object that describes the request.
The HttpListenerRequest object contains information about the request, such as the request HttpMethod string, UserAgent string, and request body data (see the InputStream property).
To reply to the request, you must get the associated response using the Response property.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
