t.w.client : module documentation

Part of twisted.web View Source

HTTP client.
Function urlunparse Undocumented
Class PartialDownloadError Page was only partially downloaded, we got disconnected in middle.
Class HTTPPageGetter Gets a resource via HTTP, then quits.
Class HTTPPageDownloader Undocumented
Class HTTPClientFactory Download a given URL.
Class HTTPDownloader Download to a file.
Function getPage Download a web page as a string.
Function downloadPage Download a web page to a file.
Class Response A Response instance describes an HTTP response received from an HTTP server.
Class ResponseDone ResponseDone may be passed to IProtocol.connectionLost on the protocol passed to Response.deliverBody and indicates that the entire response has been delivered.
Class ResponseFailed ResponseFailed indicates that all of the response to a request was not received for some reason.
Class WebClientContextFactory 0 A web context factory which doesn't work because the necessary SSL support is missing.
Class WebClientContextFactory A web context factory which ignores the hostname and port and does no certificate verification.
Class FileBodyProducer FileBodyProducer produces bytes from an input file object incrementally and writes them to a consumer.
Class HTTPConnectionPool A pool of persistent HTTP connections.
Class Agent Agent is a very basic HTTP client. It supports HTTP and HTTPS scheme URIs (but performs no certificate checking by default).
Class ProxyAgent An HTTP agent able to cross HTTP proxies.
Class CookieAgent CookieAgent extends the basic Agent to add RFC-compliant handling of HTTP cookies. Cookies are written to and extracted from a cookielib.CookieJar instance.
Class GzipDecoder A wrapper for a Response instance which handles gzip'ed body.
Class ContentDecoderAgent An Agent wrapper to handle encoded content.
Class RedirectAgent An Agent wrapper which handles HTTP redirects.
Class _URL A parsed URL.
Function _parse Split the given URL into the scheme, host, port, and path.
Function _makeGetterFactory Create and connect an HTTP page getting factory.
Class _WebToNormalContextFactory Adapt a web context factory to a normal context factory.
Class _HTTP11ClientFactory A factory for HTTP11ClientProtocol, used by HTTPConnectionPool.
Class _RetryingHTTP11ClientProtocol A wrapper for HTTP11ClientProtocol that automatically retries requests.
Class _AgentBase Base class offering common facilities for Agent-type classes.
Class _FakeUrllib2Request A fake urllib2.Request object for cookielib to work with.
Class _FakeUrllib2Response A fake urllib2.Response object for cookielib to work with.
Class _GzipProtocol A Protocol implementation which wraps another one, transparently decompressing received data.
def urlunparse(parts): (source)
def _parse(url, defaultPort=None): (source)
Split the given URL into the scheme, host, port, and path.
ParametersurlAn URL to parse. (type: bytes)
defaultPortAn alternate value to use as the port if the URL does not include one. (type: int or None)
ReturnsA four-tuple of the scheme, host, port, and path of the URL. All of these are bytes instances except for port, which is an int.
def _makeGetterFactory(url, factoryFactory, *args, contextFactory=None, **kwargs): (source)
Create and connect an HTTP page getting factory.

Any additional positional or keyword arguments are used when calling factoryFactory.

ParametersfactoryFactoryFactory factory that is called with url, args and kwargs to produce the getter
contextFactoryContext factory to use when creating a secure connection, defaulting to None
ReturnsThe factory created by factoryFactory
def getPage(url, *args, contextFactory=None, **kwargs): (source)
Download a web page as a string.

Download a page. Return a deferred, which will callback with a page (as a string) or errback with a description of the error.

See HTTPClientFactory to see what extra arguments can be passed.

def downloadPage(url, file, *args, contextFactory=None, **kwargs): (source)
Download a web page to a file.
Parametersfilepath to file on filesystem, or file-like object.

See HTTPDownloader to see what extra args can be passed.

API Documentation for Twisted, generated by pydoctor at 2013-04-03 11:20:05.