python - Getting HTTP 404 when using Requests and EdgeGrid -
please help.
i need create monitoring value of http errors in cdn akamai. how can using api?
import requests akamai.edgegrid import edgegridauth urlparse import urljoin baseurl = 'baseurl' s = requests.session() s.auth = edgegridauth( client_token='client_token', client_secret='client_secret', access_token='access_token ) result = s.get(urljoin(baseurl, '/media-reports/v1/download-delivery/19')) # 19 - id 200 http requests result.json() from code 404 status code...
so questions : 1) why have 404 response? :) 2) take needed baseurl? or need else?
thanks all.
the best way debug turn on debugging @ http level. show what's being sent , returned. can following code:
import httplib http_client http_client.httpconnection.debuglevel = 1 logging.basicconfig() logging.getlogger().setlevel(logging.debug) requests_log = logging.getlogger("requests.packages.urllib3") requests_log.setlevel(logging.debug) requests_log.propagate = true
Comments
Post a Comment