How to add text to request body in RestSharp
Here is how to add plain xml string to the request body: req.AddParameter(“text/xml”, body, ParameterType.RequestBody);
Here is how to add plain xml string to the request body: req.AddParameter(“text/xml”, body, ParameterType.RequestBody);
You don’t have to serialize the body yourself. Just do request.RequestFormat = DataFormat.Json; request.AddJsonBody(new { A = “foo”, B = “bar” }); // Anonymous type object is converted to Json body If you just want POST params instead (which would still map to your model and is a lot more efficient since there’s no serialization … Read more