Set up the Cloudflare Pages API endpoint and authentication
API_ENDPOINT = f"https://api.cloudflare.com/client/v4/accounts/{CF_ACCOUNT_ID}/pages/projects/learn-javascript/deployments/"
headers = {
"Authorization": f"Bearer {CF_API_TOKEN}",
"Content-Type": 'multipart/form-data',
"X-Auth-Email": CF_API_EMAIL,
"X-Auth-Key": CF_API_KEY,
}
# Send the request to upload the site artifact
data = {"file": open(hugo_path, "rb"), 'branch': 'main'}
response = requests.post(API_ENDPOINT, headers=headers, data=data, verify=True)
still receiving internal server error, TIA!