HttpListenerResponse Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a response to a request being handled by an HttpListener object.

System..::..Object
  System.Net..::..HttpListenerResponse

Namespace:  System.Net
Assembly:  System.Http (in System.Http.dll)

public sealed class HttpListenerResponse : IDisposable

The HttpListenerResponse type exposes the following members.

  NameDescription
Public propertyContentEncodingGets or sets the Encoding for this response's OutputStream.
Public propertyContentLength64Gets or sets the number of bytes in the body data included in the response.
Public propertyContentTypeGets or sets the MIME type of the content returned.
Public propertyHeadersGets or sets the collection of header name/value pairs returned by the server.
Public propertyKeepAliveGets or sets a value indicating whether the server requests a persistent connection.
Public propertyOutputStreamGets a Stream object to which a response can be written.
Public propertyProtocolVersionGets or sets the HTTP version used for the response.
Public propertyRedirectLocationGets or sets the value of the HTTP Location header in this response.
Public propertySendChunkedGets or sets whether the response uses chunked transfer encoding.
Public propertyStatusCodeGets or sets the HTTP status code to be returned to the client.
Public propertyStatusDescriptionGets or sets a text description of the HTTP status code returned to the client.
Top

  NameDescription
Public methodCloseSends the response to the client and releases the resources held by this HttpListenerResponse instance.
Public methodDetachSends the response to the client.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIDisposable..::..DisposeInfrastructure. Releases all resources used by the HttpListenerResponse.
Top

When a client makes a request for a resource handled by an HttpListener object, the request and response are made available to your application in an HttpListenerContext object. The request is represented by an HttpListenerRequest object and is available in the HttpListenerContext..::..Request property. The response is represented by an HttpListenerResponse object and is available in the HttpListenerContext..::..Response property.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: