C# Class HttpServer.Messages.ResponseWriter

Used to send a response back to the client.

Writes a IResponse object into a stream.

Important! ResponseWriter do not throw any exceptions. Instead it just logs them and let them die peacefully. This is since the response writer is used from catch blocks here and there.

Exibir arquivo Open project: NyxStudios/HttpServer Class Usage Examples

Public Methods

Method Description
Send ( IHttpContext context, IResponse response ) : void

Sends response using the specified context.

Send ( IHttpContext context, string data, Encoding encoding ) : void

Converts and sends a string.

SendBody ( IHttpContext context, Stream body ) : void

Send a body to the client

SendErrorPage ( IHttpContext context, IResponse response, Exception exception ) : void
SendHeaders ( IHttpContext context, IResponse response ) : void

Send all headers to the client

Method Details

Send() public method

Sends response using the specified context.
public Send ( IHttpContext context, IResponse response ) : void
context IHttpContext The context.
response IResponse The response.
return void

Send() public method

Converts and sends a string.
public Send ( IHttpContext context, string data, Encoding encoding ) : void
context IHttpContext
data string
encoding System.Text.Encoding Encoding used to transfer string
return void

SendBody() public method

Send a body to the client
public SendBody ( IHttpContext context, Stream body ) : void
context IHttpContext Context containing the stream to use.
body Stream Body to send
return void

SendErrorPage() public method

public SendErrorPage ( IHttpContext context, IResponse response, Exception exception ) : void
context IHttpContext
response IResponse
exception System.Exception
return void

SendHeaders() public method

Send all headers to the client
public SendHeaders ( IHttpContext context, IResponse response ) : void
context IHttpContext Content used to send headers.
response IResponse Response containing call headers.
return void