Class HttpResponseExtensions
Defines a collection of extensions for a
Inheritance
Namespace: MADE.Web.Extensions
Assembly: MADE.Web.dll
Syntax
public static class HttpResponseExtensions : object
Methods
| Improve this Doc View SourceWriteJsonAsync(HttpResponse, HttpStatusCode, Object)
Writes an object value as JSON to the specified response.
Declaration
public static async Task WriteJsonAsync(this HttpResponse response, HttpStatusCode statusCode, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponse | response | The HTTP response to write to. |
| HttpStatusCode | statusCode | The status code of the response. |
| System.Object | value | The object to serialize as JSON. |
Returns
| Type | Description |
|---|---|
| Task | An asynchronous operation. |
WriteJsonAsync(HttpResponse, HttpStatusCode, Object, JsonSerializerSettings)
Writes an object value as JSON to the specified response.
Declaration
public static async Task WriteJsonAsync(this HttpResponse response, HttpStatusCode statusCode, object value, JsonSerializerSettings serializerSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponse | response | The HTTP response to write to. |
| HttpStatusCode | statusCode | The status code of the response. |
| System.Object | value | The object to serialize as JSON. |
| JsonSerializerSettings | serializerSettings | The JSON serializer settings. |
Returns
| Type | Description |
|---|---|
| Task | An asynchronous operation. |
WriteJsonAsync(HttpResponse, Int32, Object)
Writes an object value as JSON to the specified response.
Declaration
public static async Task WriteJsonAsync(this HttpResponse response, int statusCode, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponse | response | The HTTP response to write to. |
| System.Int32 | statusCode | The status code of the response. |
| System.Object | value | The object to serialize as JSON. |
Returns
| Type | Description |
|---|---|
| Task | An asynchronous operation. |
WriteJsonAsync(HttpResponse, Int32, Object, JsonSerializerSettings)
Writes an object value as JSON to the specified response.
Declaration
public static async Task WriteJsonAsync(this HttpResponse response, int statusCode, object value, JsonSerializerSettings serializerSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponse | response | The HTTP response to write to. |
| System.Int32 | statusCode | The status code of the response. |
| System.Object | value | The object to serialize as JSON. |
| JsonSerializerSettings | serializerSettings | The JSON serializer settings. |
Returns
| Type | Description |
|---|---|
| Task | An asynchronous operation. |