Question

account_summary_API_url = "https://rest.developer.yodlee.com/services/srest/restserver/v1.0/account/summary/all"

account_summary_params = urllib.urlencode({'cobrandSessionToken':cobSessionToken,'userSessionToken':userSessionToken})

account_summary_response = urllib.urlopen(account_summary_API_url,account_summary_params).read()

I am using above url then encoded params to call the API but this API needs to be called with GET method . How do I enforce that ?

Was it helpful?

Solution

urllib.urlopen("http://yoururl.com/?%s" % your_url_encoded_params)

Passing the params by way of the url makes this a GET request.

So:

account_summary_response = urllib.urlopen("%s?%s" % (account_summary_API_url,account_summary_params)).read()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top