C# Class Stumps.BasicHttpResponse

A class representing a simple and basic HTTP response.
Inheritance: IStumpsHttpResponse
Mostra file Open project: Cayan-LLC/stumps Class Usage Examples

Public Methods

Method Description
AppendToBody ( byte buffer ) : void

Appends a byte array to the body of the HTTP response.

AppendToBody ( string value ) : void

Appends a string value to the body of the HTTP response.

The value will be converted to a byte array using UTF8 encoding.

AppendToBody ( string value, Encoding encoding ) : void

Appends a string value to the body of the HTTP response using a specified encoding.

BasicHttpResponse ( ) : System

Initializes a new instance of the T:Stumps.BasicHttpResponse class.

ClearBody ( ) : void

Clears the existing body of the HTTP response.

GetBody ( ) : byte[]

Gets the bytes for the HTTP body.

GetBodyAsString ( ) : string

Gets the body of the HTTP response as a T:System.String.

The body is decoded using UTF8 encoding.

GetBodyAsString ( Encoding encoding ) : string

Gets the body of the HTTP response as a T:System.String.

The body is decoded using UTF8 encoding.

Method Details

AppendToBody() public method

Appends a byte array to the body of the HTTP response.
public AppendToBody ( byte buffer ) : void
buffer byte The bytes to append to the body of the response.
return void

AppendToBody() public method

Appends a string value to the body of the HTTP response.
The value will be converted to a byte array using UTF8 encoding.
public AppendToBody ( string value ) : void
value string The value to append to the body of the HTTP response.
return void

AppendToBody() public method

Appends a string value to the body of the HTTP response using a specified encoding.
public AppendToBody ( string value, Encoding encoding ) : void
value string The value to append to the body of the HTTP response.
encoding System.Text.Encoding The encoding used to convert the into a byte array.
return void

BasicHttpResponse() public method

Initializes a new instance of the T:Stumps.BasicHttpResponse class.
public BasicHttpResponse ( ) : System
return System

ClearBody() public method

Clears the existing body of the HTTP response.
public ClearBody ( ) : void
return void

GetBody() public method

Gets the bytes for the HTTP body.
public GetBody ( ) : byte[]
return byte[]

GetBodyAsString() public method

Gets the body of the HTTP response as a T:System.String.
The body is decoded using UTF8 encoding.
public GetBodyAsString ( ) : string
return string

GetBodyAsString() public method

Gets the body of the HTTP response as a T:System.String.
The body is decoded using UTF8 encoding.
public GetBodyAsString ( Encoding encoding ) : string
encoding System.Text.Encoding The encoding used to convert the HTTP body into a .
return string