In the chapter, you will learn how to use Python as an HTTP client to make requests and retrieve web resources. You will be encouraged to try a series of example requests. We will compare urllib and the third-party requests library and show you the differences when working with forms and cookies. The third-party Requests package is a very popular alternative to urllib. It has an elegant interface and a powerful feature set, and it is a great tool for streamlining HTTP workflows. We also cover HTTP authentication mechanisms and how we can manage them with the Requests module.
The following topics will be covered in this chapter:
- Understanding the urllib package to query a REST API
- Understanding the Requests package to query a REST API
- Handling forms with urllib and requests with Python 3.7
- Handling cookies with urllib and requests with Python...