code: func CheckForJSON(r *http.Request) error {
  	ct := r.Header.Get("Content-Type")
  
  	// No Content-Type header is ok as long as there's no Body
  	if ct == "" {
  		if r.Body == nil || r.ContentLength == 0 {
  			return nil
  		}
  	}
  
  	// Otherwise it better be json
  	if matchesContentType(ct, "application/json") {
  		return nil
  	}
  	return errdefs.InvalidParameter(errors.Errorf("Content-Type specified (%s) must be 'application/json'", ct))
  }
docs: // CheckForJSON makes sure that the request's Content-Type is application/json.