title: Error in remote server: (406) No acceptable
body: <p>I'm trying to send Documents to an API to be stored.</p>
  
  <p>My code is:</p>
  
  <pre><code>HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://open.domain.com:9090/services/rest/index/my_index/document?login=john&amp;key=bag6swgsalaidhjdh47678sdff");
  request.Method = WebRequestMethods.Http.Put;
  request.ContentType = "application/json";
  request.Accept = "application/json";
  string data = doc.getJSON();
  request.ContentLength = data.Length;
  
  StreamWriter postStream = new StreamWriter(request.GetRequestStream());
  postStream.Write(doc.getJSON());
  postStream.Close();
  
  try
  {
      var response = (HttpWebResponse)request.GetResponse();
  } catch (Exception e)
  {
      Console.WriteLine("Error: "+e.Message);
  }
  </code></pre>
  
  <p>It just try to send a Document in JSON format and always return a WebException.</p>
  
  <p>Here you can see the specifications from the documentation as it should be done:</p>
  
  <pre><code>curl -XPUT -H "Content-Type: application/json" \
      -d '[{"lang": "ENGLISH","fields": [{ "name": "id", "value": 1 }]}]' \
      http://localhost:8080/services/rest/index/my_index/document
  </code></pre>
  
  <p>And here how to authenticate:</p>
  
  <pre><code>curl -XPUT -H "Content-Type: application/json" \
      -d '[{"lang": "ENGLISH","fields": [{ "name": "id", "value": 1 }]}]' \
      http://localhost:9090/services/rest/index/my_index/document?login=lorem&amp;key=08762e43getye0042f875e86eaiu687f
  </code></pre>
  
  <p>Always received the same exception: Error 406 No acceptable.</p>
  
  <p>So, what's wrong?</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>data in Json format (data):</p>
  
  <blockquote>
    <p>{"fields":[{"name":"titulo","value":"el
    titulo"},{"name":"descripcion","value":"el
    titulo"},{"name":"free","value":"el
    titulo"},{"name":"friendly_url","value":"el
    titulo"},{"name":"ID","value":"el titulo"},{"name":"url","value":"el
    titulo"},{"name":"url_imagen","value":"el
    titulo"},{"name":"plataforma","value":"nueva"},{"name":"hide","value":"0"}]</p>
  </blockquote>
  
  <p>From the documentation</p>
  
  <p><strong>Inserting documents using JSON</strong></p>
  
  <p>Use this API to create or update documents in the index.</p>
  
  <p>Requirement: OpenSearchServer v1.5</p>
  
  <p>Call parameters</p>
  
  <p>URL: /services/rest/index/{index_name}/document</p>
  
  <p>Method: PUT</p>
  
  <p>HTTP Header:</p>
  
  <p>Content-Type (required): application/json
  Accept (optional returned type): application/json or application/xml</p>
  
  <p>URL parameters:</p>
  
  <p>index_name (required): The name of the index.</p>
  
  <p>Raw data (PUT):
  An array of documents.</p>