(reqdata)
Call the CloudFlare API
Call the CloudFlare API
Call the CloudFlare API
def callAPI(reqdata):
    ''' Call the CloudFlare API '''
    headers = {"Content-type": "application/x-www-form-urlencoded"}
    try:
        req = requests.post(
            url="https://www.cloudflare.com/api_json.html",
            data=reqdata, headers=headers)
    except:
        response = {'result': 'false'}
        return response

    if req.status_code == 200:
        response = json.loads(req.text)
        return response
    else:
        response = {'result': 'false'}
        return response
def callAPI ( reqdata ) : headers = { "Content-type" : "application/x-www-form-urlencoded" } try : req = requests . post ( url = "https://www.cloudflare.com/api_json.html" , data = reqdata , headers = headers ) except : response = { 'result' : 'false' } return response if req . status_code == 200 : response = json . loads ( req . text ) return response else : response = { 'result' : 'false' } return response