Class ResponseSerializer
Provides standard response serializer callbacks.
Inherited Members
Namespace: EmbedIO
Syntax
public static class ResponseSerializer
Fields
Default
The default response serializer callback used by EmbedIO.
Equivalent to Json(IHttpContext, Object).
Declaration
public static readonly ResponseSerializerCallback Default
Field Value
Type | Description |
---|---|
ResponseSerializerCallback |
Methods
Json(IHttpContext, Object)
Serializes data in JSON format to a HTTP response,
using the
Declaration
public static Task Json(IHttpContext context, object data)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | The HTTP context of the request. |
Object | data | The data to serialize. |
Returns
Type | Description |
---|---|
Task | A |
Json(JsonSerializerCase)
Serializes data in JSON format with the specified jsonSerializerCase
to a HTTP response, using the
Declaration
public static ResponseSerializerCallback Json(JsonSerializerCase jsonSerializerCase)
Parameters
Type | Name | Description |
---|---|---|
JsonSerializerCase | jsonSerializerCase | The JSON serializer case. |
Returns
Type | Description |
---|---|
ResponseSerializerCallback | A ResponseSerializerCallback that can be used to serialize data to a HTTP response. |
Json(SerializerOptions)
Serializes data in JSON format with the specified serializerOptions
to a HTTP response, using the
Declaration
public static ResponseSerializerCallback Json(SerializerOptions serializerOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializerOptions | serializerOptions | The JSON serializer options. |
Returns
Type | Description |
---|---|
ResponseSerializerCallback | A ResponseSerializerCallback that can be used to serialize data to a HTTP response. |