code: def _http_resource(self, method, resource, params=None, data=None):
          
  
          if not is_collection(resource):
              resource = [resource]
  
          url = self._url_for(*resource)
          r = self._session.request(method, url, params=params, data=data)
  
          if r.status_code == 422:
              http_error = HTTPError('%s Client Error: %s' %
                                     (r.status_code, r.content.decode("utf-8")))
              http_error.response = r
              raise http_error
  
          r.raise_for_status()
  
          return r
docs: Makes an HTTP request.