title: Azure Search using REST c#
body: <p>I am trying to run the following code:</p>
  
  <pre><code>public class Item
  {
      [JsonProperty(PropertyName = "api-key")]
      public string apikey { get; set; }
  
  }
  
  [[some method]]{
              var url = "https://[search service name].search.windows.net/indexes/temp?api-version=2016-09-01"; 
  
              using (var httpClient = new HttpClient())
              {
                  using (var request = new HttpRequestMessage(HttpMethod.Put,url))
                  {
                      request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));                        
                      var sItem = new Item { apikey = [AzureSearchAdminKey] };
                      var tststring = JsonConvert.SerializeObject(sItem);
                      var body=new  StringContent(tststring, Encoding.UTF8,"application/json" );
  
  
  
                      request.Content =  body;
  
                      request.Method = HttpMethod.Put;
  
                      using (HttpResponseMessage response = httpClient.SendAsync(request).Result)
                      {                                                       
                          var stringr = response.Content.ReadAsStringAsync().Result;
                          Console.WriteLine(stringr);
                          Console.ReadLine();
                      }
  
                  }  
              }
  
  }
  </code></pre>
  
  <p>I get the following error:
  "Error reading JObject from JsonReader. Path '', line 0, position 0."</p>
  
  <p>Could someone from search team tell me what I did wrong?</p>