これは私の実用的なソリューションです:
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> version = 'v1'
>>> apikey = '[YOUR KEY HERE]'
>>> print(requests.get('http://api.espn.com/' + version + '/sports?apikey=' + apikey))
<Response [200]>
>>>
これも機能します:
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> url = 'http://api.espn.com/v1/sports'
>>> params = dict(
... apikey = '[YOUR KEY HERE]'
... )
>>> print(requests.get(url=url, params=params))
<Response [200]>
>>>