Class RequestHandler
Provides standard request handler callbacks.
Inherited Members
Namespace: EmbedIO
Syntax
public static class RequestHandler
Methods
PassThrough()
Returns an exception object that, when thrown from a module's HandleRequestAsync(IHttpContext) method, will cause the HTTP context to be passed down along the module chain, regardless of the value of the module's IsFinalHandler property.
Declaration
public static Exception PassThrough()
Returns
| Type | Description |
|---|---|
| Exception | A newly-created |
ThrowBadRequest(String)
Returns a RequestHandlerCallback that unconditionally sends a 400 Bad Request response.
Declaration
public static RequestHandlerCallback ThrowBadRequest(string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | message | A message to include in the response. |
Returns
| Type | Description |
|---|---|
| RequestHandlerCallback |
ThrowForbidden(String)
Returns a RequestHandlerCallback that unconditionally sends a 403 Forbidden response.
Declaration
public static RequestHandlerCallback ThrowForbidden(string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | message | A message to include in the response. |
Returns
| Type | Description |
|---|---|
| RequestHandlerCallback |
ThrowMethodNotAllowed(String)
Returns a RequestHandlerCallback that unconditionally sends a 405 Method Not Allowed response.
Declaration
public static RequestHandlerCallback ThrowMethodNotAllowed(string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | message | A message to include in the response. |
Returns
| Type | Description |
|---|---|
| RequestHandlerCallback |
ThrowNotFound(String)
Returns a RequestHandlerCallback that unconditionally sends a 404 Not Found response.
Declaration
public static RequestHandlerCallback ThrowNotFound(string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | message | A message to include in the response. |
Returns
| Type | Description |
|---|---|
| RequestHandlerCallback |
ThrowUnauthorized(String)
Returns a RequestHandlerCallback that unconditionally sends a 401 Unauthorized response.
Declaration
public static RequestHandlerCallback ThrowUnauthorized(string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | message | A message to include in the response. |
Returns
| Type | Description |
|---|---|
| RequestHandlerCallback |