title: restsharp PUT request error --> "StatusCode: InternalServerError, Content-Type: application/json, Content-Length: -1)"
body: <p>I want to do a PUT request via a REST API. I've got the access_token, which should be correct. I'm trying to upload a JSON object of relation, but I get the following error:</p>
  
  <p>restsharp PUT request error:<br></p>
  
  <blockquote>
    <p>“StatusCode: InternalServerError, Content-Type: application/json,
    Content-Length: -1)”</p>
  </blockquote>
  
  <pre><code>public void Store(HiveClient hiveClient,string _putUrl, string _url, string _clientId, string _clientSecret, HiveObject objToStore)
  {
      hiveClient = new HiveClient(_url, _clientId, _clientSecret);
      hiveClient.CheckIfFileExists();
      string token = hiveClient.restToken;
      HiveObject hiveObject = objToStore;
      var json = JsonConvert.SerializeObject(hiveObject);
      RestClient restClient = new RestClient(_putUrl);
      RestRequest request = new RestRequest(Method.PUT);
      request.AddHeader("Authorization", token);
      request.AddParameter("application/json; charset=utf-8", json, ParameterType.RequestBody);
      request.AddJsonBody(json);
      request.RequestFormat = DataFormat.Json;
      IRestResponse respons = restClient.Execute&lt;HiveObject&gt;(request);
      var deserialize = new JsonDeserializer();
      var output = deserialize.Deserialize&lt;Dictionary&lt;string, string&gt;&gt;(respons);
  } 
  </code></pre>