code: func (h *Handler) handlePostIndex(w http.ResponseWriter, r *http.Request) {
  	if !validHeaderAcceptJSON(r.Header) {
  		http.Error(w, "JSON only acceptable response", http.StatusNotAcceptable)
  		return
  	}
  	indexName := mux.Vars(r)["index"]
  
  	resp := successResponse{h: h}
  
  	// Decode request.
  	req := postIndexRequest{
  		Options: pilosa.IndexOptions{
  			Keys:           false,
  			TrackExistence: true,
  		},
  	}
  	err := json.NewDecoder(r.Body).Decode(&req)
  	if err != nil && err != io.EOF {
  		resp.write(w, err)
  		return
  	}
  	_, err = h.api.CreateIndex(r.Context(), indexName, req.Options)
  
  	resp.write(w, err)
  }
docs: // handlePostIndex handles POST /index request.