code: func (h *Handler) handlePostIndexAttrDiff(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"]
  
  	// Decode request.
  	var req postIndexAttrDiffRequest
  	if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
  		http.Error(w, err.Error(), http.StatusBadRequest)
  		return
  	}
  
  	attrs, err := h.api.IndexAttrDiff(r.Context(), indexName, req.Blocks)
  	if err != nil {
  		if errors.Cause(err) == pilosa.ErrIndexNotFound {
  			http.Error(w, err.Error(), http.StatusNotFound)
  		} else {
  			http.Error(w, err.Error(), http.StatusInternalServerError)
  		}
  		return
  	}
  
  	// Encode response.
  	if err := json.NewEncoder(w).Encode(postIndexAttrDiffResponse{
  		Attrs: attrs,
  	}); err != nil {
  		h.logger.Printf("response encoding error: %s", err)
  	}
  }
docs: // handlePostIndexAttrDiff handles POST /internal/index/attr/diff requests.