O'Reilly logo

Foundations of Python Network Programming: The comprehensive guide to building network applications with Python, Second Edition by John Goerzen, Brandon Rhodes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required