Table of Contents

Class SystemTextJsonSerializer

Namespace
RestSharp.Serializers.Json
Assembly
RestSharp.dll
public class SystemTextJsonSerializer : IRestSerializer, ISerializer, IDeserializer
Inheritance
SystemTextJsonSerializer
Implements
Inherited Members

Constructors

SystemTextJsonSerializer()

Create the new serializer that uses System.Text.Json.JsonSerializer with default settings

public SystemTextJsonSerializer()

SystemTextJsonSerializer(JsonSerializerOptions)

Create the new serializer that uses System.Text.Json.JsonSerializer with custom settings

public SystemTextJsonSerializer(JsonSerializerOptions options)

Parameters

options JsonSerializerOptions

Json serializer settings

Properties

AcceptedContentTypes

public string[] AcceptedContentTypes { get; }

Property Value

string[]

ContentType

public string ContentType { get; set; }

Property Value

string

DataFormat

public DataFormat DataFormat { get; }

Property Value

DataFormat

Deserializer

public IDeserializer Deserializer { get; }

Property Value

IDeserializer

Serializer

public ISerializer Serializer { get; }

Property Value

ISerializer

SupportsContentType

public SupportsContentType SupportsContentType { get; }

Property Value

SupportsContentType

Methods

Deserialize<T>(RestResponse)

public T? Deserialize<T>(RestResponse response)

Parameters

response RestResponse

Returns

T

Type Parameters

T

Serialize(Parameter)

public string? Serialize(Parameter bodyParameter)

Parameters

bodyParameter Parameter

Returns

string

Serialize(object?)

public string? Serialize(object? obj)

Parameters

obj object

Returns

string