How do I make a GET
query with request body using RestSharp
(I'm using RestSharp v. 106.6.10
with .NET Core 2.2
). I can do it using WebClient
/Postman
etc. no problem.
Here's the code failing with {["A non-empty request body is required."]}
.
var client = new RestClient("BaseUri");
var request = new RestRequest("URL", Method.GET);
request.AddJsonBody(Body);
client.Execute(request); // {["A non-empty request body is required."]}
This represents a valid use case, pity if it's not supported.
Update: The motivation for having GET requests with body is to avail of get requests having complex parameters, which can't be nicely encoded into a query string. I know people serialize their jsons an put them into a querystrings but I'd rather put it into a request body, considering it's a permissible usage after all.