code: def MakeRequestAndDecodeJSON(self, url, method, **kwargs):
      
      method_upper = method.upper()
      if method_upper not in ('GET', 'POST'):
        raise ValueError('Method {0:s} is not supported')
  
      if url.lower().startswith('https'):
        self._CheckPythonVersionAndDisableWarnings()
  
      try:
        if method_upper == 'GET':
          response = requests.get(url, **kwargs)
  
        elif method_upper == 'POST':
          response = requests.post(url, **kwargs)
  
        response.raise_for_status()
  
      except requests.ConnectionError as exception:
        error_string = 'Unable to connect to {0:s} with error: {1!s}'.format(
            url, exception)
        raise errors.ConnectionError(error_string)
  
      except requests.HTTPError as exception:
        error_string = '{0:s} returned a HTTP error: {1!s}'.format(
            url, exception)
        raise errors.ConnectionError(error_string)
  
      return response.json()
docs: Make a HTTP request and decode the results as JSON.
  
      Args:
        url (str): URL to make a request to.
        method (str): HTTP method to used to make the request. GET and POST are
            supported.
        kwargs: parameters to the requests .get() or post() methods, depending
            on the value of the method parameter.
  
      Returns:
        dict[str, object]: body of the HTTP response, decoded from JSON.
  
      Raises:
        ConnectionError: If it is not possible to connect to the given URL, or it
            the request returns a HTTP error.
        ValueError: If an invalid HTTP method is specified.