Skip to content

RestRequest.JsonSerializer = new JsonCustomSerializer<T>() not working #1251

Description

@andrewkip

Hello!

It seems that in new version RestSharp 106.6.3.0 ovveriding JSon Serializer in RestRequest.JsonSerializer not working
for example:
var request = new RestRequest
{
Method = Method.POST,
RequestFormat = DataFormat.Json,
JsonSerializer = new JsonCustomSerializer()
};

request.AddJsonBody(obj);

but JsonCustomSerializer.Serialize not calling...
and ContentType of Body not equal to JsonCustomSerializer.ContentType

have to do dirty Hack:
request.AddJsonBody( request.JsonSerializer.Serialize(obj));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions