HTTP Programming and Web Authentication
This chapter introduces the urllib
and requests
modules for making requests and retrieving web resources. The third-party requests
module is a very popular alternative to the urllib
module; it has an elegant interface and a powerful feature set, and it is a great tool for streamlining HTTP workflows. Also, we cover HTTP authentication mechanisms and how we can manage them with the requests
module. Finally, we cover how to implement OAuth clients and JWT for token generation in web applications with the requests-oauthlib
and jwt
modules.
This chapter will provide us with the foundation to become familiar with different alternatives within Python when we need to use a module that provides different functionality to make requests to a web service or a REST API.
The following topics will be covered in this chapter:
- Building an HTTP client with the
urllib
module - Building an HTTP client with the
requests
module - Authentication...