I\'m building a client for an RSS reading service. I\'m using the RestSharp library to interact with their API.
The API states:
When creating
Although this is a bit old: I ran into the same problem.. seems some attributes such as "content-type" or "date" cannot be added as parameter but are added internally. To alter the value of "content-type" I had to change the serialzer setting (altough I didn`t use it because I added a json in the body that was serialized before!)
RestClient client = new RestClient(requURI);
RestRequest request = new RestRequest(reqPath, method);
request.JsonSerializer.ContentType = "application/json; charset=utf-8";
as soon as I did this the header showed up as intended:
System.Net Information: 0 : [5620] ConnectStream#61150033 - Header
{
Accept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml
User-Agent: RestSharp 104.1.0.0
Content-Type: application/json; charset=utf-8
...
}