code: func generateUnexpectedResponseCodeError(resp *http.Response) error {
  	var buf bytes.Buffer
  	io.Copy(&buf, resp.Body)
  	resp.Body.Close()
  	return fmt.Errorf("Unexpected response code: %d (%s)", resp.StatusCode, buf.Bytes())
  }
docs: // generateUnexpectedResponseCodeError consumes the rest of the body, closes
  // the body stream and generates an error indicating the status code was
  // unexpected.