Class FileRequestHandler
Provides standard handler callbacks for FileModule.
Inherited Members
Namespace: EmbedIO.Files
Syntax
public static class FileRequestHandler
Methods
PassThrough(IHttpContext, MappedResourceInfo)
Unconditionally passes a request down the module chain.
Declaration
public static Task PassThrough(IHttpContext context, MappedResourceInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpContext | context | An IHttpContext interface representing the context of the request. |
| MappedResourceInfo | info | If the requested path has been successfully mapped to a resource (file or directory), the result of the mapping; otherwise, null. |
Returns
| Type | Description |
|---|---|
| Task | This method never returns; it throws an exception instead. |
ThrowMethodNotAllowed(IHttpContext, MappedResourceInfo)
Unconditionally sends a 405 Method Not Allowed response.
Declaration
public static Task ThrowMethodNotAllowed(IHttpContext context, MappedResourceInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpContext | context | An IHttpContext interface representing the context of the request. |
| MappedResourceInfo | info | If the requested path has been successfully mapped to a resource (file or directory), the result of the mapping; otherwise, null. |
Returns
| Type | Description |
|---|---|
| Task | This method never returns; it throws a HttpException instead. |
ThrowNotFound(IHttpContext, MappedResourceInfo)
Unconditionally sends a 404 Not Found response.
Declaration
public static Task ThrowNotFound(IHttpContext context, MappedResourceInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpContext | context | An IHttpContext interface representing the context of the request. |
| MappedResourceInfo | info | If the requested path has been successfully mapped to a resource (file or directory), the result of the mapping; otherwise, null. |
Returns
| Type | Description |
|---|---|
| Task | This method never returns; it throws a HttpException instead. |
ThrowUnauthorized(IHttpContext, MappedResourceInfo)
Unconditionally sends a 403 Unauthorized response.
Declaration
public static Task ThrowUnauthorized(IHttpContext context, MappedResourceInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpContext | context | An IHttpContext interface representing the context of the request. |
| MappedResourceInfo | info | If the requested path has been successfully mapped to a resource (file or directory), the result of the mapping; otherwise, null. |
Returns
| Type | Description |
|---|---|
| Task | This method never returns; it throws a HttpException instead. |