[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Provides access to the request and response objects used by the HttpListener class. This class cannot be inherited.
Assembly: System.Http (in System.Http.dll)
Thetype exposes the following members.
|Close()()()()||Closes the stream attached to this listener context.|
|Close(Int32)||Closes the stream attached to this listener context with the specified value for how long the socket should linger after closing.|
|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 instance.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
This class provides the information related to a client's Hypertext Transfer Protocol (HTTP) request being processed by an HttpListener object. This class also has methods that allow an HttpListener object to accept a WebSocket connection.
The GetContext method returns instances of the class. To get the object that represents the client request, use the Request property. To get the object that represents the response that will be sent to the client by the HttpListener, use the Response property. To get user information about the client sending the request, such as its login name and whether it has been authenticated, you can query the properties in the object returned by the property.
Closing an object sends the response to the client and frees any resources used by the . Aborting an object discards the response to the client if it has not already been sent, and frees any resources used by the . After closing or aborting an object, you cannot reference its methods or properties. If you do so, you will receive an ObjectDisposedException exception.