Skip to content

AddJsonBody in 107.0.1 does not work properly #1687

Closed
@sergeisk360

Description

@sergeisk360

I have noticed that AddJsonBody works differently in 107.0.1 version. I am using RestSharp with Pingdom API and have very simple method to pause/resume host.

Here is an example of method in 106.11.7 version

        public IRestResponse ResumeHost(string hostID)
        {
            var request = new RestRequest("checks", DataFormat.Json);
            request.AddJsonBody(new
            {
                checkids = hostID,
                paused = false
            });
            return client.Put(request);
        }

And same code in version 107.0.1

        public async Task<RestResponse> ResumeHostAsync(string hostID)
        {
            var request = new RestRequest("checks") { RequestFormat = DataFormat.Json };
            request.AddJsonBody(new
            {
                checkids = hostID,
                paused = false
            });
            return await client.PutAsync(request);
        }

Second code doesn't work properly and looks like object was not posted properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions