title: In curl, how do I force header content-type to application/json?
body: <p>Hello I am trying to follow the tutorial on this page:</p>
  
  <p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/_index_and_query_a_document.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/_index_and_query_a_document.html</a></p>
  
  <p>In this part we are adding a customer. However, when I follow the instructions (copy as curl and paste in cmd), I get an error 406.</p>
  
  <p>The curl instruction copied pastes into cmd exactly as follows:</p>
  
  <pre><code>curl -X PUT "localhost:9200/customer/_doc/1?pretty" -H 'Content-Type: application/json' -d'
  {
    "name": "John Doe"
  }
  '
  </code></pre>
  
  <p>Which results in each line being individually processed (not sure of the correct terminology):
  <a href="https://i.stack.imgur.com/jDZFN.png" rel="nofollow noreferrer">screen-cap of cmd showing each line being processed. ugh.</a></p>
  
  <p>Which uncorks a fountain of errors.</p>
  
  <p>If I copy it all into one line, it looks like this:</p>
  
  <pre><code>curl -X PUT "localhost:9200/customer/_doc/1?pretty" -H'Content-Type:json' -d '{  "name": "John Doe"}'
  </code></pre>
  
  <p>Which isn't quite so redic but still gives me an error:</p>
  
  <pre><code>{
    "error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
    "status" : 406
  }
  curl: (6) Could not resolve host: name
  curl: (3) [globbing] unmatched close brace/bracket in column 9
  </code></pre>
  
  <p>Which is strange because I <strong>didn't plinkin set the content type to that, it's pretty clear I set it to json.</strong> (sorry I've wasted half my weekend on this and I'm tired of it.)</p>
  
  <p>Can anyone tell me what I am doing wrong? Or some good places to start looking? I know there's a lot of config that could be wrong, but everything has worked up till now; the PUT and GET requests on the previous page worked, so I don't know why this all of a sudden doesn't work.</p>