code: def _request(method, url, content_type=None, _data=None, user=None, passwd=None):
      '''
      Makes a HTTP request. Returns the JSON parse, or an obj with an error.
      '''
      opener = _build_opener(_HTTPHandler)
      request = _Request(url, data=_data)
      if content_type:
          request.add_header('Content-Type', content_type)
      if user and passwd:
          auth_encode = '{0}:{1}'.format(user, passwd).encode('base64')[:-1]
          auth_basic = "Basic {0}".format(auth_encode)
          request.add_header('Authorization', auth_basic)
          request.add_header('Accept', 'application/json')
      request.get_method = lambda: method
      try:
          handler = opener.open(request)
      except HTTPError as exc:
          return {'error': '{0}'.format(exc)}
      return salt.utils.json.loads(handler.read()f _request(method, url, content_type=None, _data=None, user=None, passwd=None):
      '''
      Makes a HTTP request. Returns the JSON parse, or an obj with an error.
      '''
      opener = _build_opener(_HTTPHandler)
      request = _Request(url, data=_data)
      if content_type:
          request.add_header('Content-Type', content_type)
      if user and passwd:
          auth_encode = '{0}:{1}'.format(user, passwd).encode('base64')[:-1]
          auth_basic = "Basic {0}".format(auth_encode)
          request.add_header('Authorization', auth_basic)
          request.add_header('Accept', 'application/json')
      request.get_method = lambda: method
      try:
          handler = opener.open(request)
      except HTTPError as exc:
          return {'error': '{0}'.format(exc)}
      return salt.utils.json.loads(handler.read())
docs: Makes a HTTP request. Returns the JSON parse, or an obj with an error.