Skip to content

Response .content is coming out to be null when calling a PUt method. #522

@gargleo

Description

@gargleo

var client = new RestClient(_serviceUrl);
var request = new RestRequest("/{resourcetype}({key})", Method.PUT);
request.AddUrlSegment("key", key.ToString());
request.AddUrlSegment(ResourceName, resourcetype);
request.AddHeader(ContentType, "application/json");
request.RequestFormat = DataFormat.Json;
request = UpdateRequestHeader(request);
request.AddBody(resource);
Log4Test.LogInfo(request.ToString());
IRestResponse response = client.Execute(request);

in the code above used for updaing the data using PUT , is returning null in response.content.

Anything needs to be changed?

for other like POST ,GET , DELETE response is getting returned correctly.

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