Python Requests
While there are other libraries available in python to work with HTTP services, you will save yourself much frustration by only working with the requests module for interacting with external web services. You should become familiar with how to use the requests module to interact with external APIs to download resources or exchange data.
Goals/Objectives/Outcomes
- Understand how to install the requests modeule and make simple requests
- Understand how to use request parameters for both GET and POST
- Understand how to parse response content
- Understand how to work with reponse status codes
- Understand how to work with cookies and request history
- Understand the range of advanced options available including authentication and streaming
Reference Material
- http://www.python-requests.org/en/latest/
- http://www.python-requests.org/en/latest/user/quickstart/
- http://www.python-requests.org/en/latest/user/advanced/
- https://pypi.python.org/pypi/requests
- http://engineering.hackerearth.com/2014/08/21/python-requests-module/
- http://www.pythonforbeginners.com/requests/using-requests-in-python
- http://docs.python-guide.org/en/latest/scenarios/scrape/
Measures of Success
- Participant has demonstrated the ability to use the requests module to work with an external http service or API
- Participant has demonstrated the ability to parse json output and do bulk downloads from an external service
- Participant has demonstrated the ability to authenticate to an external service using the requests module
- Participant has demonstrated the ability to construct POST requests that send formatted data to an external service