Send a response.
Namespace:
HttpServerAssembly: HttpServer (in HttpServer.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
void Respond( string httpVersion, HttpStatusCode statusCode, string reason, string body, string contentType ) |
| Visual Basic (Declaration) |
|---|
Sub Respond ( _ httpVersion As String, _ statusCode As HttpStatusCode, _ reason As String, _ body As String, _ contentType As String _ ) |
| Visual C++ |
|---|
void Respond( String^ httpVersion, HttpStatusCode statusCode, String^ reason, String^ body, String^ contentType ) |
Parameters
- httpVersion
- Type: System..::.String
Either HTTP10 or HTTP11
- statusCode
- Type: System.Net..::.HttpStatusCode
HTTP status code
- reason
- Type: System..::.String
reason for the status code.
- body
- Type: System..::.String
HTML body contents, can be null or empty.
- contentType
- Type: System..::.String
A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentException | If httpVersion is invalid. |