Summary

We looked at the principles of the HTTP protocol. We saw how to perform numerous fundamental tasks with the standard library urllib and the third-party Requests packages.

We looked at the structure of HTTP messages, HTTP status codes, the different headers that we may encounter in requests and responses, and how to interpret them and use them for customizing our requests. We looked at how URLs are formed, and how to manipulate and construct them.

We saw how to handle cookies and redirects, how to handle errors that might occur, and how to use secure HTTP connections.

We also covered how to submit data to websites in the manner of submitting a form on a web page, and how to extract the parameters that we need from a page's source code.

Finally, ...

Get Learning Python Network Programming 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.