Connection connecting object. The HttxConnection is responsible for
creating and managing an underlying httplib.HTTPConnection or a HTTPSxConnection (for HTTPS) to perform the actual
connection
The creation of the underlying connection is based upon a dictionary
holding the class types indexed by the connection scheme (http or
https)
The connection handles automatically redirection, authentication (auth
and digest) and decompression (gzip, bzip2, deflate)
|
|
HttxConnection
|
|
HttxConnection
|
clone(self,
options=None)
Clone the object using the supplied options or a new set of options
if given. |
source code
|
|
|
reset(self)
Reset the conn instance variable to None (possibly after an exception
happened) to allow the connection to re-issue a createconnection on
"request" |
source code
|
|
|
sslize(self,
url)
Add the appropriate "certificates" and/or paths and options
to an underlying https connection to allow it to successfully (and
according to user request) execute |
source code
|
|
|
doconnect(self)
Actual connection (with https certificate preparation) |
source code
|
|
|
createconnection(self,
url,
sock=None,
plaintunnel=False)
Helper function to enable delayed creation of the underlying
connection if needed. |
source code
|
|
|
tunnelconnect(self,
httxreq,
plaintunnel=False)
Tunnel a connection over CONNECT if needed and not already done and
re-create the underlying connection to use the "CONNECT"ed
tunnel |
source code
|
|
|
tunnelsslize(self)
If the user has connected a tunnel manually and asked for "plain
tunnel" the tunnel may still be wrapped by ssl manually |
source code
|
|
opaque type for the caller (a Python sock)
|
request(self,
httxreq)
Send the HttxRequest httxreq to the specified server inside
the request It does so by creating a connection if needed, then
setting headers with helper functions for ompression, cookies and
authentication and then relaying the call to the underlying
connection |
source code
|
|
HttxResponse (compatible with httplib HTTPResponse)
|
|
|
addcookies(self,
httxreq)
Add a Cookie header to httxreq if needed It uses a urllib2 cookiejar
from the options set |
source code
|
|
|
|
|
addauth(self,
httxreq)
Add a WWW-Authenticate or Proxy-Authenticate header to httxreq if
needed and set in the options |
source code
|
|
|
|
|
|
|
addcontent(self,
httxreq)
Add headers to httxreq if data is transmitted, borrowed from urllib2. |
source code
|
|
|
extractcookies(self,
response)
Perform cookie extraction from a response into a urllib2 cookiejar in
the options set |
source code
|
|
|
decompress(self,
response)
Perform body decompression if enabled by the options and present in
the response |
source code
|
|
|
tunneling(self,
response)
Checks if a tunnel (CONNECT) request was in place and if it has been
correctly established. |
source code
|
|
HttxResponse
|
redirect(self,
response)
Perform redirection if the response requests it and enabled by the
options set |
source code
|
|
HttxResponse
|
authenticate(self,
response,
plaintunnel=False)
Perform authentication if the response requests it and enabled by the
options set |
source code
|
|
Inherited from httxbase.HttxBase :
add_ca_cert ,
add_cert_req ,
add_certkey ,
add_password ,
setdecompmethods ,
setoptions ,
setproxy ,
setuseragent ,
urlopen
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
dict
|
connFactory = dict(http= HTTPConnection, https= HTTPSxConnection)
class variable holding the dictionary of connection classes used to
instantiate connections
|
|
tunnelFactory = dict(http= HTTPxTunneled, https= HTTPSxTunneled)
class variable holding the dictionary of connection classes used to
instantiate tunneled connections
|
HttxConnection
|
auxhttx
Reference to the auxiliary connection used for either authentication
or rediretion if needed
|
httplib.HTTPConnection or HTTPSxConnection - subclass of
httplib.HTTPSConnection
|
conn
actual connection object
|
HttxRequest
|
lastreq
Last HttxRequest request issued
|
namedtuple from urlsplit
|
parsed
it holds the result of urlsplit(url) for practical purposes
|
int
|
redircount
count of redirections so far performed
|
|
timestamp
last time the connection was used @type int
|
str
|
url
url used to set the net location to which connections will connect
|
Inherited from httxbase.HttxBase :
options
Inherited from httxobject.HttxObject :
lock
|