t.w.client : module documentation

Part of twisted.web View Source

HTTP client.
Class PartialDownloadError Page was only partially downloaded, we got disconnected in middle.
Class HTTPPageGetter Undocumented
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.
Function _parse Split the given URL into the scheme, host, port, and path.
Function _makeGetterFactory Create and connect an HTTP page getting factory.
def _parse(url, defaultPort=None): (source)
Split the given URL into the scheme, host, port, and path.
ParametersurlAn URL to parse. (type: str )
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 str 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 args can be passed.
def downloadPage(url, file, *args, contextFactory=None, **kwargs): (source)
Download a web page to a file.
Parametersfile

path 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 2011-10-27 16:02:37.