Skip to content

Instantly share code, notes, and snippets.

@tonytan4ever
Last active August 29, 2015 14:10
Show Gist options
  • Save tonytan4ever/14d64f3e448a6c25ee1b to your computer and use it in GitHub Desktop.
Save tonytan4ever/14d64f3e448a6c25ee1b to your computer and use it in GitHub Desktop.
import requests
import json
from akamai.edgegrid import EdgeGridAuth
def main():
s = requests.Session()
s.auth = EdgeGridAuth(
# This is rax_test credential
client_token = '<your_client_token>',
client_secret='<your_client_secret>',
access_token='<your_access_token>')
response = s.get(
'<your_access_url>/partner-api/v1/network/production/properties/208892/sub-properties/<policy_name>/policy',
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'})
print response.status_code
print json.loads(response.text)
resp_dict = json.loads(response.text)
print resp_dict
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment