Created
March 20, 2015 20:03
-
-
Save tonytan4ever/5d39a76b31dfc22ac97b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
from akamai.edgegrid import EdgeGridAuth | |
def main(): | |
s = requests.Session() | |
s.auth = EdgeGridAuth( | |
client_token = '<your client token>', | |
client_secret='<your client secret>', | |
access_token='<your access url>') | |
data = { | |
'objects': [ | |
#'/123' | |
'https://wp.altcdn.com/wp-content/uploads/2014/09/*' | |
] | |
} | |
base_url = 'https://<your_base_url>/ccu/v2/queues/default' | |
#base_url = 'https://api.ccu.akamai.com/ccu/v2/queues/default' | |
response = s.post( | |
base_url, | |
data=json.dumps(data), | |
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}) | |
print response.status_code | |
print response.headers | |
print response.text | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment