Share via


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.

Inheritance Hierarchy

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

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

Syntax

'Declaration
Public NotInheritable Class HttpListenerResponse _
    Implements IDisposable
public sealed class HttpListenerResponse : IDisposable
public ref class HttpListenerResponse sealed : IDisposable
[<Sealed>]
type HttpListenerResponse =  
    class
        interface IDisposable
    end
public final class HttpListenerResponse implements IDisposable

The HttpListenerResponse type exposes the following members.

Properties

  Name Description
Public property ContentEncoding Gets or sets the Encoding for this response's OutputStream.
Public property ContentLength64 Gets or sets the number of bytes in the body data included in the response.
Public property ContentType Gets or sets the MIME type of the content returned.
Public property Headers Gets or sets the collection of header name/value pairs returned by the server.
Public property KeepAlive Gets or sets a value indicating whether the server requests a persistent connection.
Public property OutputStream Gets a Stream object to which a response can be written.
Public property ProtocolVersion Gets or sets the HTTP version used for the response.
Public property RedirectLocation Gets or sets the value of the HTTP Location header in this response.
Public property SendChunked Gets or sets whether the response uses chunked transfer encoding.
Public property StatusCode Gets or sets the HTTP status code to be returned to the client.
Public property StatusDescription Gets or sets a text description of the HTTP status code returned to the client.

Top

Methods

  Name Description
Public method Close Sends the response to the client and releases the resources held by this HttpListenerResponse instance.
Public method Detach Sends the response to the client.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IDisposable. . :: . .Dispose Infrastructure. Releases all resources used by the HttpListenerResponse.

Top

Remarks

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.

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.

See Also

Reference

System.Net Namespace