Get raw JSON Data of REST request in RestSharp

Viewed 1814

I use RestSharp to access a Sever API.

RestClient client = new RestClient(serverUrl);

JObject parameters = new JObject
        {
           new JProperty("Param1", p1),
           new JProperty("Param2", p2)
        }; 

RestRequest request = new RestRequest("/Foo", Method.POST);
request.AddParameter("application/json; charset=UTF-8", parameters, ParameterType.RequestBody);

Is there a way to get the raw JSON Data of the REST request in RestSharp?

2 Answers

As of 2019, RestSharp has yet to provide a way to get the raw JSON Data of the request, but you can always use some web debugging proxy like Fiddler.

Related