HttpListenerRequest Class
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Describes an incoming HTTP request to an HttpListener object. This class cannot be inherited.
Inheritance Hierarchy
System. . :: . .Object
System.Net..::..HttpListenerRequest
Namespace: System.Net
Assembly: System.Http (in System.Http.dll)
Syntax
'Declaration
Public Class HttpListenerRequest
public class HttpListenerRequest
public ref class HttpListenerRequest
type HttpListenerRequest = class end
public class HttpListenerRequest
The HttpListenerRequest type exposes the following members.
Properties
Name | Description | |
---|---|---|
AcceptTypes | Gets the MIME types accepted by the client. | |
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. | |
Credentials | Gets the user's network credentials, if the user has sent a user name and password. | |
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. | |
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. | |
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. | |
Url | Gets the Uri object requested by the client. | |
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. |
Top
Methods
Name | Description | |
---|---|---|
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.) | |
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.) | |
Reset | Clears values for the HttpListenerRequest instance. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
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.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.