Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to use "requests" and "requests_cache" modules to call web services #4

Open
JTFouquier opened this issue May 5, 2016 · 2 comments

Comments

@JTFouquier
Copy link
Collaborator

http://docs.python-requests.org/en/latest/

https://github.com/reclosedev/requests-cache

"requests" is a module much better than build-in urllib and urllib2.

"request_cache" provides a cache for requests, regardless the actual caching headers. Very useful for both development and actual data-loading.

Example code:

#!python

import requests
import requests_cache

requests_cache.install_cache('arrayexpress_cache')

res = requests.get('http://www.ebi.ac.uk/arrayexpress/json/v2/experiments/E-GEOD-19279')
data = res.json()

res = requests.get('http://www.ebi.ac.uk/arrayexpress/files/E-GEOD-19279/E-GEOD-19279.sdrf.txt')
data = res.text()


@JTFouquier
Copy link
Collaborator Author

done


Original comment by: jin_xuefeng

1 similar comment
@JTFouquier
Copy link
Collaborator Author

done


Original comment by: jin_xuefeng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant