In this section, we'll start to write Python code to perform HTTP requests using the requests library.
Interacting with a web app using the requests library
Requests library
Requests is an Apache 2 licensed HTTP library written in Python. It was created to reduce the complexity and work needed when using urllib2 and other HTTP libraries available at the moment.
This is an example of the code needed to perform a request to api.github.com using authentication when using the urllib2 library:
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
password_manager.add_password(None, gh_url, 'user', 'pass')
auth_manager...