(key, **params)
return None
Send a request to the clusterfuzz api.

  Returns a json dict of the response.
Send a request to the clusterfuzz api.
Send a request to the clusterfuzz api .
def APIRequest(key, **params):
  """Send a request to the clusterfuzz api.

  Returns a json dict of the response.
  """

  params["api_key"] = key
  params = urllib.urlencode(params)

  headers = {"Content-type": "application/x-www-form-urlencoded"}

  try:
    conn = httplib.HTTPSConnection(HOSTNAME)
    conn.request("POST", "/_api/", params, headers)

    response = conn.getresponse()

    # Never leak "data" into public logs.
    data = response.read()
  except:
    raise Exception("ERROR: Connection problem.")

  try:
    return json.loads(data)
  except:
    raise Exception("ERROR: Could not read response. Is your key valid?")

  return None
def APIRequest ( key , * * params ) : params [ "api_key" ] = key params = urllib . urlencode ( params ) headers = { "Content-type" : "application/x-www-form-urlencoded" } try : conn = httplib . HTTPSConnection ( HOSTNAME ) conn . request ( "POST" , "/_api/" , params , headers ) response = conn . getresponse ( ) # Never leak "data" into public logs. data = response . read ( ) except : raise Exception ( "ERROR: Connection problem." ) try : return json . loads ( data ) except : raise Exception ( "ERROR: Could not read response. Is your key valid?" ) return None