<PackageReference Include="System.Net.Http.Json" Version="10.0.9" />

System.Net.Http.Json.JsonContent

public sealed class JsonContent : HttpContent
Provides HTTP content based on JSON.
public Type ObjectType { get; }

Gets the type of the Value to be serialized by this instance.

public object Value { get; }

Gets the value to be serialized and used as the body of the HttpRequestMessage that sends this instance.

public static JsonContent Create<T>(T inputValue, MediaTypeHeaderValue mediaType = null, JsonSerializerOptions options = null)

Creates a new instance of the JsonContent class that will contain the inputValue serialized as JSON.

public static JsonContent Create(object inputValue, Type inputType, MediaTypeHeaderValue mediaType = null, JsonSerializerOptions options = null)

Creates a new instance of the JsonContent class that will contain the inputValue serialized as JSON.

public static JsonContent Create<T>(T inputValue, JsonTypeInfo<T> jsonTypeInfo, MediaTypeHeaderValue mediaType = null)

Creates a new instance of the JsonContent class that will contain the inputValue serialized as JSON.

public static JsonContent Create(object inputValue, JsonTypeInfo jsonTypeInfo, MediaTypeHeaderValue mediaType = null)

Creates a new instance of the JsonContent class that will contain the inputValue serialized as JSON.