An HTTP 1.1 client.

The way to use the functionality provided by this module is to:

Various other classes in this module support this usage:

  • HTTPParser is the basic HTTP parser. It can handle the parts of HTTP which are symmetric between requests and responses.
  • HTTPClientParser extends HTTPParser to handle response-specific parts of HTTP. One instance is created for each request to parse the corresponding response.
Class BadHeaders Headers passed to Request were in some way invalid.
Class ExcessWrite The body IBodyProducer for a request tried to write data after indicating it had finished writing data.
Class ParseError Some received data could not be parsed.
Class BadResponseVersion The version string in a status line was unparsable.
Class ConnectionAborted The connection was explicitly aborted by application code.
Class WrongBodyLength An IBodyProducer declared the number of bytes it was going to produce (via its length attribute) and then produced a different number of bytes.
Class RequestNotSent No summary
Class HTTPParser HTTPParser handles the parsing side of HTTP processing. With a suitable subclass, it can parse either the client side or the server side of the connection.
Class HTTPClientParser An HTTP parser which only handles HTTP responses.
Class Request A Request instance describes an HTTP request to be sent to an HTTP server.
Class LengthEnforcingConsumer An IConsumer proxy which enforces an exact length requirement on the total data written to it.
Function makeStatefulDispatcher No summary
Class ChunkedEncoder Helper object which exposes IConsumer on top of HTTP11ClientProtocol for streaming request bodies to the server.
Class TransportProxyProducer An twisted.internet.interfaces.IPushProducer implementation which wraps another such thing and proxies calls to it until it is told to stop.
Class HTTP11ClientProtocol HTTP11ClientProtocol is an implementation of the HTTP 1.1 client protocol. It supports as few features as possible.
Class _WrapperException _WrapperException is the base exception type for exceptions which include one or more other exceptions as the low-level causes.
Function _callAppFunction Call function. If it raises an exception, log it with a minimal description of the source.
def _callAppFunction(function): (source)

Call function. If it raises an exception, log it with a minimal description of the source.

def makeStatefulDispatcher(name, template): (source)

Given a dispatch name and a function, return a function which can be used as a method and which, when called, will call another method defined on the instance and return the result. The other method which is called is determined by the value of the _state attribute of the instance.

ParametersnameA string which is used to construct the name of the subsidiary method to invoke. The subsidiary method is named like '_%s_%s' % (name, _state).
templateA function object which is used to give the returned function a docstring.
ReturnsThe dispatcher function.
API Documentation for Twisted, generated by pydoctor at 2017-06-11 10:59:01.