code: func (c *Client) write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) {
  	r := c.newRequest("PUT", endpoint)
  	r.setWriteOptions(q)
  	r.obj = in
  	rtt, resp, err := requireOK(c.doRequest(r))
  	if err != nil {
  		return nil, err
  	}
  	defer resp.Body.Close()
  
  	wm := &WriteMeta{RequestTime: rtt}
  	if out != nil {
  		if err := decodeBody(resp, &out); err != nil {
  			return nil, err
  		}
  	} else if _, err := ioutil.ReadAll(resp.Body); err != nil {
  		return nil, err
  	}
  	return wm, nil
  }
docs: // write is used to do a PUT request against an endpoint
  // and serialize/deserialized using the standard Consul conventions.