Package suds :: Package transport :: Module http :: Class HttpTransport
[hide private]
[frames] | no frames]

Class HttpTransport

source code

Transport --+
            |
           HttpTransport
Known Subclasses:

HTTP transport using urllib2. Provided basic http transport that provides for cookies, proxies but no authentication.

Instance Methods [hide private]
 
__init__(self, **kwargs)
Constructor.
source code
stream
open(self, request)
Open the url in the specified request.
source code
Reply
send(self, request)
Send soap message.
source code
u2request: urllib2.Requet.
addcookies(self, u2request)
Add cookies in the cookiejar to the request.
source code
u2request: urllib2.Requet.
getcookies(self, fp, u2request)
Add cookies in the request to the cookiejar.
source code
fp
u2open(self, u2request)
Open a connection.
source code
OpenerDirector
u2opener(self)
Create a urllib opener.
source code
[Handler,...]
u2handlers(self)
Get a collection of urllib handlers.
source code
float
u2ver(self)
Get the major/minor version of the urllib2 lib.
source code
 
__deepcopy__(self, memo={}) source code
Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

source code 

Constructor.

Parameters:
  • kwargs - Keyword arguments.
    • proxy - An http proxy to be specified on requests. The proxy is defined as {protocol:proxy,}
      • type: dict
      • default: {}
    • timeout - Set the url open timeout (seconds).
      • type: float
      • default: 90
Overrides: Transport.__init__

open(self, request)

source code 

Open the url in the specified request.

Parameters:
  • request - A transport request.
Returns: stream
An input stream.
Raises:
Overrides: Transport.open
(inherited documentation)

send(self, request)

source code 

Send soap message. Implementations are expected to handle:

  • proxies
  • http headers
  • cookies
  • sending message
  • brokering exceptions into TransportError
Parameters:
  • request - A transport request.
Returns: Reply
The reply
Raises:
Overrides: Transport.send
(inherited documentation)

addcookies(self, u2request)

source code 

Add cookies in the cookiejar to the request.

Parameters:
  • u2request - A urllib2 request.
Returns: u2request: urllib2.Requet.

getcookies(self, fp, u2request)

source code 

Add cookies in the request to the cookiejar.

Parameters:
  • u2request - A urllib2 request.
Returns: u2request: urllib2.Requet.

u2open(self, u2request)

source code 

Open a connection.

Parameters:
  • u2request (urllib2.Requet.) - A urllib2 request.
Returns: fp
The opened file-like urllib2 object.

u2opener(self)

source code 

Create a urllib opener.

Returns: OpenerDirector
An opener.

u2handlers(self)

source code 

Get a collection of urllib handlers.

Returns: [Handler,...]
A list of handlers to be installed in the opener.

u2ver(self)

source code 

Get the major/minor version of the urllib2 lib.

Returns: float
The urllib2 version.