Property | Type | Description | |
---|---|---|---|
HTTPResponse | System | ||
SendError | void | ||
SendError | void | ||
SetHeaderIfNotExists | void |
Method | Description | |
---|---|---|
Dispose ( ) : void | ||
Respond ( Stream outputStream ) : void |
Writes the response to the output stream. This method should only be called in certain special cases where the route solving system is being short-circuited somehow, because the route solving system is usually in charge of calling this method.
|
|
SetHeader ( string header, string value ) : void |
Sets the value of an HTTP Response Header. Many standard headers are defined in WebServer.HTTPHeader, but custom headers can always be manually set in case this is desired. Headers are sent in the
|
|
SetStatusCode ( int responseCode, string responseMessage ) : void |
Set the status and message code of the response
|
|
WriteError ( HTTPStatusCode errorCode, string errorMessage ) : void |
Sends a nicely-formatted error with specified HTTP Error Code and Error Message to the client. This response is not buffered and thus calling this method will immediately send the response to the client.
|
|
WriteError ( HTTPStatusCode errorCode, string errorMessage, string errorContent, string mimeType ) : void |
Sends a custom-formatted error with specified HTTP Error Code, Error Message Response Content and mime type to the client. This response is not buffered and thus calling this method will immediately send the response to the client.
|
|
WriteHTML ( string html ) : void |
Writes a specified string to the response buffer and sets the Content-Type header to be
|
|
WriteStream ( Stream stream ) : void |
Writes a stream to the response buffer. This method is used mainly when serving files in a more efficient way. This method does not modify the Content-Type header and if nothing is done, the default value of
|
|
WriteString ( string text ) : void |
Writes a specified string to the response buffer. Does not modify the Content-Type header. Default Content-Type is
|
Method | Description | |
---|---|---|
Dispose ( bool disposing ) : void | ||
DoError ( |
Method | Description | |
---|---|---|
HTTPResponse ( ) : System | ||
SendError ( int errorCode, string errorMessage ) : void | ||
SendError ( int errorCode, string errorMessage, string responseContent, string mimeType ) : void | ||
SetHeaderIfNotExists ( string header, string value ) : void |
protected static DoError ( |
||
response | ||
exception | ||
return | void |
public Respond ( Stream outputStream ) : void | ||
outputStream | Stream | The stream in which to copy the output. Does not close the stream |
return | void |
public SetHeader ( string header, string value ) : void | ||
header | string |
/// The name of the header, for example:
///
|
value | string | /// The value of the header. /// |
return | void |
public SetStatusCode ( int responseCode, string responseMessage ) : void | ||
responseCode | int | |
responseMessage | string | |
return | void |
public WriteError ( HTTPStatusCode errorCode, string errorMessage ) : void | ||
errorCode | HTTPStatusCode | The HTTP Status Code to send |
errorMessage | string | The Error Message to send. For example "Not Found" or "Not Supported" |
return | void |
public WriteError ( HTTPStatusCode errorCode, string errorMessage, string errorContent, string mimeType ) : void | ||
errorCode | HTTPStatusCode | The HTTP Status Code to send |
errorMessage | string | The Error Message to send. For example "Not Found" or "Not Supported" |
errorContent | string | |
mimeType | string | |
return | void |
public WriteHTML ( string html ) : void | ||
html | string | /// The text to write. Encoding will be solved automatically. /// |
return | void |
public WriteString ( string text ) : void | ||
text | string | /// The text to write. Encoding will be solved automatically. /// |
return | void |