title: RestSharp defaulting Content-Type to application/x-www-form-urlencoded on POST
body: <p>RestSharp seems to not allow me to override the Content-Type for a post request. I've followed the directions found <a href="http://itanex.blogspot.com/2012/02/restsharp-and-advanced-post-requests.html" rel="nofollow">here</a> to no avail. I've also tried manually setting the header content type to application/json via request.AddHeaders("content-type", "application/json");</p>
  
  <p>Examples of the request execution:</p>
  
  <pre><code>private IRestResponse ExecuteRequest&lt;T&gt;(string resource, Method method, T model)
  {
      var client = CreateRestClient();
      var request = new RestRequest(resource, method) 
      { 
          RequestFormat = DataFormat.Json 
      };
      var json = JsonConvert.SerializeObject(model);
  
      request.AddHeader("Accept", "application/json");
      request.AddHeader("User-Agent", "Fiddler");
      request.Parameters.Clear();
      request.AddParameter("auth_token", _apiKey);
      request.AddParameter("application/json", json, ParameteType.RequestBody);
  
      return client.Execute(request); 
  }
  </code></pre>
  
  <p>The response error message:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
    "error": {
    "code": 400,
    "message": "The request requires a properly encoded body with the 'content-type' header set to '['application/json']",
    "type": "Bad Request" }
  }
  </code></pre>
  
  <p>Fiddler request raw data:</p>
  
  <pre class="lang-none prettyprint-override"><code>POST  **omitted** HTTP/1.1
  Accept: application/json, application/xml, text/json, text/x-json,text/javascript, text/xml
  User-Agent: RestSharp/105.0.1.0
  Content-Type: application/x-www-form-urlencoded
  Host: **omitted**
  Content-Length: 51
  Accept-Encoding: gzip, deflate
  Connection: Keep-Alive
  </code></pre>
  
  <p>As you can see, the request Content-Type is still application/x-www-form-urlencoded. Any ideas? (thanks in advance)</p>