Sisk

Method

HttpRequest.GetJsonContent<T>

Namespace
Sisk.Core.Http
Assembly
Sisk.Core.dll

GetJsonContent<T>(JsonTypeInfo<T>) #

Deserializes the request body into an object of type T using the provided JsonTypeInfo.

C#
public T? GetJsonContent<T>(JsonTypeInfo<T> typeInfo)

Parameters #

typeInfo JsonTypeInfo<T>

The JsonTypeInfo to use for deserialization.

Returns #

T?

The deserialized object, or null if the request body is empty.

Type Parameters #

T

The type of the object to deserialize into.

GetJsonContent<T>(JsonSerializerOptions?) #

Deserializes the request body into an object of type T using the provided JsonSerializerOptions.

C#
[RequiresDynamicCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
[RequiresUnreferencedCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
public T? GetJsonContent<T>(JsonSerializerOptions? jsonOptions = null)

Parameters #

jsonOptions JsonSerializerOptions?

The JsonSerializerOptions to use for deserialization.

Returns #

T?

The deserialized object, or null if the request body is empty.

Type Parameters #

T

The type of the object to deserialize into.

GetJsonContent<T>() #

Deserializes the request body into an object of type T using the default JsonSerializerOptions from DefaultJsonSerializerOptions.

C#
[RequiresDynamicCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
[RequiresUnreferencedCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
public T? GetJsonContent<T>()

Returns #

T?

The deserialized object, or null if the request body is empty.

Type Parameters #

T

The type of the object to deserialize into.

Type to search the documentation and the API reference.