Class e.p.h.h.ElisaHttpClient(Loggable):

Part of elisa.plugins.http_client.http_client View In Hierarchy

Known subclasses: elisa.plugins.http_client.http_client.ElisaAdvancedHttpClient

twisted.web2 based HTTP client.

It connects to a given server and optionally supports request pipelining. It does not support HTTP redirections.

Line # Kind Name Docs
177 Method __init__ Constructor.
215 Method request Send an HTTP request.
229 Method request_full Send an HTTP request.
244 Method close Close an open HTTP connection.
268 Method is_busy Test whether the client is busy processing requests.
350 Method connectionFailed Callback invoked by the HTTP client factory when the connection fails.
362 Method connectionLost Callback invoked by the HTTP client factory when losing the connection.
397 Method connectionLostForever Callback invoked by the HTTP client factory when the connection is lost
419 Method connectionMade Callback invoked by the HTTP client protocol when the connection is
435 Method requestWriteFinished Callback invoked by the HTTP client protocol when a request has been
197 Method _reset Undocumented
203 Method _open Open an HTTP connection.
280 Method _queue_request Enqueue a request to submit to the server.
313 Method _submit_next_request Undocumented
346 Method _callback_request_defer Undocumented
450 Method _request_done Callback invoked when receiving the response to a request.
def __init__(self, host, port=80, pipeline=True):
Constructor.
Parametershosthostname or IP address of the server (type: str )
portTCP port on which the server listens (type: int )
pipelinewhether the client should pipeline requests (type: bool )
def _reset(self):
Undocumented
def _open(self):
Open an HTTP connection.

This is a non-blocking method. One should wait for self._open_defer to be fired before attempting to send any request to the server. This method should not be called explicitely, the connection will be opened upon reception of the first request.

def request(self, uri, method='GET'):
Send an HTTP request.
Parametersurithe URI of the resource to request (type: str )
methodthe HTTP method of the request (default: GET) (type: str )
Returnsa deferred triggered when the request is executed (type: elisa.core.utils.cancellable_defer.CancellableDeferred )
def request_full(self, request):
Send an HTTP request.
Parametersrequestrequest to submit (type: elisa.plugins.http_client.extern.client_http.ClientRequest )
Returnsa deferred triggered when the request is executed (type: elisa.core.utils.cancellable_defer.CancellableDeferred )
def close(self):
Close an open HTTP connection.
Returnsa deferred triggered when the connection is closed (type: twisted.internet.defer.Deferred )
def is_busy(self):
Test whether the client is busy processing requests.
ReturnsTrue if the client is busy, False otherwise (type: bool )
def _queue_request(self, request):
Enqueue a request to submit to the server.
Parametersrequestrequest to submit (type: twisted.web2.client.http.ClientRequest )
Returnsa deferred triggered when the request is executed (type: elisa.core.utils.cancellable_defer.CancellableDeferred )
def _submit_next_request(self, result=None):
Undocumented
def _callback_request_defer(self, result, request):
Undocumented
def connectionFailed(self, connector, reason):
Callback invoked by the HTTP client factory when the connection fails.
Parametersconnectorthe TCP connector (type: twisted.internet.tcp.Connector )
reasonthe reason of the connection failure (type: twisted.python.failure.Failure )
def connectionLost(self, connector, reason):
Callback invoked by the HTTP client factory when losing the connection.
Parametersconnectorthe TCP connector (type: twisted.internet.tcp.Connector )
reasonthe reason of the connection loss (type: twisted.python.failure.Failure )
ReturnsFalse if the connection has been closed, True otherwise. (type: bool )
def connectionLostForever(self, connector, reason):
Callback invoked by the HTTP client factory when the connection is lost forever. This happens when the maximum number of connection retries is reached.
Parametersconnectorthe TCP connector (type: twisted.internet.tcp.Connector )
reasonthe reason of the last connection loss (type: twisted.python.failure.Failure )
def connectionMade(self, protocol):
Callback invoked by the HTTP client protocol when the connection is established.
Parametersprotocolthe HTTP client protocol (type: ElisaHttpClientProtocol )
def requestWriteFinished(self, req):
Callback invoked by the HTTP client protocol when a request has been fully written.
Parametersreqthe channel request that has been written (type: http_client.extern.client_http.HTTPClientChannelRequest )
def _request_done(self, response, request):
Callback invoked when receiving the response to a request.
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.