title: Creating an index with REST API
body: <p>I'm trying to create an index within a set under a specific namespace, but am unsure how to do it. </p>
  
  <p>My resources have this as an HTTP example:</p>
  
  <pre><code>POST /example/v1/index/{namespace}/{set}/{indexName}
  </code></pre>
  
  <p>and for an example input:</p>
  
  <pre><code> {
   "fields": [
       { "indexField": "firstName", "indexReverseOrder": true },
       { "indexField": "lastName" }
   ],
   "options": {
       "isUnique": true
   }
  }
  </code></pre>
  
  <p>this consumes</p>
  
  <pre><code>application/json;charset=UTF-8
  </code></pre>
  
  <p>but when I write this out as </p>
  
  <pre><code>curl -X POST exampleurl.com/example/v1/index/example_namespace/example_set/example
  set -d " {
   "fields": [
       { "indexField": "firstName", "indexReverseOrder": true },
       { "indexField": "lastName" }
   ],
   "options": {
       "isUnique": true
   } }" -H "Content-type : application/json;charset=UTF-8"
  </code></pre>
  
  <p>I get the following HTTP status code</p>
  
  <pre><code>HTTP/1.1 415 Unsupported Media Type
  </code></pre>
  
  <p>Can anyone explain to me what's going on  and how I might fix this? Also, let me know if you don't have enough information about the API to understand it, thanks!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>As some sort of a reference, for this API when I create a set in a namespace I do:</p>
  
  <pre><code>curl -X POST http://exampleurl.com/example/v1/store/example_namespace -d "example_set" -H "Content-type: application/json;charset=UTF-8" 
  </code></pre>
  
  <p>and this is successful. I thought indexes would be similar to this, but apparently not.</p>