Foundations of Python Network Programming: The comprehensive guide to building network applications with Python, Second Edition
by Brandon Rhodes, John Goerzen
Chapter 9. HTTP
The protocols of yore tended to be dense, binary, and decipherable only by Boolean machine logic. But the workhorse protocol of the World Wide Web, named the Hypertext Transfer Protocol (HTTP), is instead based on friendly, mostly-human-readable text. There is probably no better way to start this chapter than to show you what an actual request and response looks like; that way, you will already know the layout of a whole request as we start digging into each of its features.
Consider what happens when you ask the urllib2 Python Standard Library to open this URL, which is the RFC that defines the HTTP protocol itself: www.ietf.org/rfc/rfc2616.txt
The library will connect to the IETF web site, and send it an HTTP request that looks ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access