Last active
August 29, 2015 14:10
-
-
Save tonytan4ever/14d64f3e448a6c25ee1b 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( | |
# 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