code: func (s *Service) handleRemove(w http.ResponseWriter, r *http.Request) {
  	b, err := ioutil.ReadAll(r.Body)
  	defer r.Body.Close()
  	if err != nil {
  		w.WriteHeader(http.StatusBadRequest)
  		return
  	}
  	m := map[string]string{}
  	if err := json.Unmarshal(b, &m); err != nil {
  		w.WriteHeader(http.StatusBadRequest)
  		return
  	}
  
  	if len(m) != 1 {
  		w.WriteHeader(http.StatusBadRequest)
  		return
  	}
  
  	remoteID, ok := m["id"]
  	if !ok {
  		w.WriteHeader(http.StatusBadRequest)
  		return
  	}
  
  	if err := s.store.Remove(remoteID); err != nil {
  		if err == store.ErrNotLeader {
  			leader := s.leaderAPIAddr()
  			if leader == "" {
  				http.Error(w, err.Error(), http.StatusServiceUnavailable)
  				return
  			}
  
  			redirect := s.FormRedirect(r, leader)
  			http.Redirect(w, r, redirect, http.StatusMovedPermanently)
  			return
  		}
  
  		w.WriteHeader(http.StatusInternalServerError)
  		return
  	}
  }
docs: // handleRemove handles cluster-remove requests.