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.

Afficher le fichier Open project: NyxStudios/HttpServer Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

Send() public méthode

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
Résultat void

SendBody() public méthode

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
Résultat void

SendErrorPage() public méthode

public SendErrorPage ( IHttpContext context, IResponse response, Exception exception ) : void
context IHttpContext
response IResponse
exception System.Exception
Résultat void

SendHeaders() public méthode

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.
Résultat void