O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

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

httplib

This module implements the client side of the Hypertext Transfer Protocol (HTTP) used in web applications. Both the HTTP/1.0 and HTTP/1.1 protocols are supported. In addition, if Python is configured with OpenSSL support, connections can be made using secure sockets. This module is not normally used directly; instead, you should consider using urllib or urllib2. However, HTTP is such an important protocol, this module is covered in some detail in this section. For more details about HTTP, consult RFC 2616 (HTTP/1.1) and RFC 1945 (HTTP/1.0).

The HTTP protocol is a simple text-based protocol that works as follows:

1.
A client makes a connection to a web server and sends a request header of the following form:
 GET /document.html HTTP/1.0 ...

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