I want to make a request using RestSharp when content-type = application/json
, I now need to make a request application/x-www-form-urlencoded
but I can not find the correct way to do this, here is an example of how I mount the request application/json
:
var request = new RestRequest(Method.POST);
request.Resource = "/search";
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/json; charset=utf-8");
request.AddParameter("application/json", JsonConvert.SerializeObject(new { bucketId = bucketID, startFileName = fileName, maxFileCount = maxFileCount }), ParameterType.RequestBody);
request.AddHeader("Authorization", authorize_account.authorizationToken);
The way I pass the body when it comes to JSON is this, how do I do when it comes to x-www-form-urlencoded?