slimta.http

Root package for slimta HTTP client and server libraries.

This package contains implementations of HTTP classes from httplib using gevent sockets. These are provided to avoid the complete re-implementation that ships in gevent.httplib, and to provide a more similar interface to other slimta libraries that use SSL/TLS.

class slimta.http.HTTPConnection(host[, port=None[, *args[, **kwargs]]])

Modified version of the httplib.HTTPConnection class that uses gevent sockets. This attempts to avoid the complete re-implementation that ships in gevent.httplib.

class slimta.http.HTTPSConnection(host[, port=None[, *args[, **kwargs]]])

Modified version of the httplib.HTTPSConnection class that uses gevent sockets.

slimta.http.get_connection(url[, context=None])

This convenience functions returns a HTTPConnection or HTTPSConnection based on the information contained in URL.

Parameters:
  • url – URL string to create a connection for. Alternatively, passing in the results of urlparse.urlsplit() works as well.
  • context (SSLContext) – Used to wrap sockets with SSL encryption, when the URL scheme is https.

Sub-Modules: