HTTP Programming

This chapter will introduces you to the HTTP protocol and covers how we can retrieve and manipulate web content using Python. We will also review the urllib standard library and requests package. urllib2 is a Python module for fetching URLs. It offers a very simple interface, in the form of the urlopen function. The request package is a very useful tool if we want to make requests to API endpoints to streamline HTTP workflows.

The following topics will be covered in this chapter:

  • Understanding the HTTP Protocol and building HTTP clients in Python
  • Understanding the urllib package to query a REST API
  • Understanding the requests package to query a REST API
  • Understanding the different authentication mechanisms and how they are ...

Get Mastering Python for Networking and Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.