Untitled
unknown
plain_text
2 years ago
803 B
8
Indexable
import requests
account_id = ['']
bearer = ['']
worker_name = ['']
for z in worker_name:
for i, j in zip(bearer, account_id):
headers = {
'Content-Type': 'application/javascript',
'Authorization': 'Bearer '+i
}
headers1 = {
'Content-Type': 'application/json',
'Authorization': 'Bearer '+i
}
data1 = {"subdomain":j}
response1 = requests.put(
'https://api.cloudflare.com/client/v4/accounts/'+j+'/workers/subdomain',
headers=headers1,
json=data1,
)
if response1.status_code == 200:
print('Worker Created Enabled: ', response1.json())
else:
print('Error Creating Worker:', response1.json())
Editor is loading...