{"success":false,"errors":[{"code":9106,"message":"Missing X-Auth-Key, X-Auth-Email or Authorization headers"}]}
I’ve been angry with this problem for a week, and no matter how accurate information is entered, an error occurs. The server is creating a web using Python in aws. I’m asking for advice, as it’s not a problem I can solve alone. I want to know if my python code is wrong.
api_key = ""
email = ""
zone_id = ""
headers = {"X-Auth-Email" : email, "X-Auth-Key" : api_key}
json_data = {"type" : "A", "name" : request.form["url"], "content" : "ip", "ttl" : 1, "proxied" : True}
try:
res_data = requests.post(f"https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records", headers=headers, json=json_data).json()
except:
pass
return "ok"