Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53923
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-09-10 08:44 -0700 |
| References | <37fa354c-691c-45f9-ab31-807f86340e4d@googlegroups.com> <mailman.199.1378793757.5461.python-list@python.org> <8a64d6c4-dd35-4f0e-88a2-8b5c2f093ac5@googlegroups.com> |
| Message-ID | <381d34a8-36a7-4982-9816-36aee397b9e0@googlegroups.com> (permalink) |
| Subject | Re: python REST API access fails after adding date to URL |
| From | mahsan9861@gmail.com |
Found a solution. For query string you have to add it to both the http_headers dictionary AND to the URL when making the Request.
old line:
http_headers = {}
http_headers['oauth_version'] = '1.0'
new line:
http_headers = {}
http_headers['date'] = 'ddmmyyyy' #add this line
http_headers['oauth_version'] = '1.0'
old line:
req = urllib2.Request(base_url)
new line:
req = urllib2.Request(base_url + '?date=ddmmyyyy')
Everything else remains the same.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
python REST API access fails after adding date to URL mahsan9861@gmail.com - 2013-09-09 09:36 -0700
Re: python REST API access fails after adding date to URL dieter <dieter@handshake.de> - 2013-09-10 08:15 +0200
Re: python REST API access fails after adding date to URL mahsan9861@gmail.com - 2013-09-10 07:33 -0700
Re: python REST API access fails after adding date to URL mahsan9861@gmail.com - 2013-09-10 08:42 -0700
Re: python REST API access fails after adding date to URL mahsan9861@gmail.com - 2013-09-10 08:44 -0700
csiph-web