Closed lesserwhirls closed 9 years ago
Replace code like this:
latest_url = 'nearesttime?&' + 'stid=' + stid + '&' + '&'.join(['%s=%s' % (key, value) for (key, value) in kwargs.items()]) + '&token=' + token
with the built-in Requests support for using dictionaires, and allow Requests to build the request string.
Example from Requests doc:
payload = {'key1': 'value1', 'key2[]': ['value2', 'value3']} r = requests.get("http://httpbin.org/get", params=payload) print(r.url) http://httpbin.org/get?key1=value1&key2%5B%5D=value2&key2%5B%5D=value3
Thanks for your help today and the walkthrough. Code was replaced in commit 3a413f4
Replace code like this:
latest_url = 'nearesttime?&' + 'stid=' + stid + '&' + '&'.join(['%s=%s' % (key, value) for (key, value) in kwargs.items()]) + '&token=' + token
with the built-in Requests support for using dictionaires, and allow Requests to build the request string.
Example from Requests doc: