code: func (s *Adaptor) request(method string, url string, params url.Values) (m map[string]interface{}, err error) {
  	var resp *http.Response
  
  	if method == "POST" {
  		resp, err = http.PostForm(url, params)
  	} else if method == "GET" {
  		resp, err = http.Get(url)
  	}
  
  	if err != nil {
  		return
  	}
  
  	buf, err := ioutil.ReadAll(resp.Body)
  
  	if err != nil {
  		return
  	}
  
  	json.Unmarshal(buf, &m)
  
  	if resp.Status != "200 OK" {
  		err = fmt.Errorf("%v: error communicating to the Particle cloud", resp.Status)
  	} else if _, ok := m["error"]; ok {
  		err = errors.New(m["error"].(string))
  	}
  
  	return
  }
docs: // request makes request to Particle cloud server, return err != nil if there is
  // any issue with the request.