This module defines classes which implement the client side of the
HTTP and HTTPS protocols. It is normally not used directly -- the
module urllibuses it to handle URLs
that use HTTP and HTTPS. Note:
HTTPS support is only
available if the socket module was compiled with SSL
support.
An HTTPConnection instance represents one transaction with an HTTP
server. It should be instantiated passing it a host and optional port number.
If no port number is passed, the port is extracted from the host string if it
has the form host:port, else the default HTTP port (80) is
used. For example, the following calls all create instances that connect to
the server at the same host and port:
A subclass of HTTPConnection that uses SSL for communication with
secure servers. Default port is 443.
key_file is
the name of a PEM formatted file that contains your private
key. cert_file is a PEM formatted certificate chain file.
Warning:
This does not do any certificate verification!
The following exceptions are raised as appropriate: