Chapter 4: HTTP Programming
This chapter will introduce you to the HTTP protocol and cover how we can retrieve and manipulate web content using Python. We also take a look at the standard urllib
library, as well as requests
and httpx
packages. In addition, we'll look at the third-party requests
module, which 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. Finally, we will cover HTTP authentication mechanisms and how we can manage them with the requests
module.
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 REST API.
The following topics will be covered in this chapter:
- Introducing the HTTP protocol
- Building an HTTP client with http.client
- Building an HTTP client with urllib.request
- Building...