Method
HttpRequest.GetJsonContent<T>
GetJsonContent<T>(JsonTypeInfo<T>) #
Deserializes the request body into an object of type T using the provided JsonTypeInfo.
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.
[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.
[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.