Package CyberRail :: Package common :: Module httpclient
[hide private]
[frames] | no frames]

Module httpclient

source code

An asynchronous HTTP 1.1 client, with stream management.

This module allows you to send HTTP 1.1 requests asynchronously: this way you can, while the request is managed, do other stuffs. In order for this to work, you'll have to use the communication manager module, that manage asynchronous operations on sockets and file descriptors.

See Request class for details.

If you don't plan to use a specific instance of ConnectionsPool, please register a communication manager before use (see setCommunicationManager()).

Created on 21 juil. 09


Author: Emmanuel Coirier

Classes [hide private]
  HTTPError
  Connection
A connection to a server.
  Headers
  ConnectionsPool
Manage connections to hosts requested by the http client.
  Request
A request is all the data needed by an HTTP transaction to complete.
  Response
A Response is the data the server returns when we request it.
  BasicAuthRequest
HTTP Request conforming to RFC 2617 for Basic Authentication only.
Functions [hide private]
 
_getConnectionPool()
Return the module's connection pool.
source code
 
setCommunicationManager(cm)
Set the communication manager that will be used to create TCP connections.
source code
 
onHttpResponse(resp) source code
Variables [hide private]
  _connectionsPool = None
The global connection pool.
  _communicationManager = None
The communication manager used by the connection pool.
  DELAYED = -1
The request body will be defined later.
  CALLBACK = -2
The response body will be transmited via callback
  STORE = -3
The response body will be stored in the response
  __package__ = 'CyberRail.common'
Function Details [hide private]

_getConnectionPool()

source code 

Return the module's connection pool. Raise an error if a communication manager has not been set.

setCommunicationManager(cm)

source code 

Set the communication manager that will be used to create TCP connections.

You should call this function before using other part of this module. You should call this function only one time.


Variables Details [hide private]

_connectionsPool

The global connection pool. Instanciated on the fly.

Value:
None