| | |
- exceptions.Exception
-
- HTTPException
-
- BadStatusLine
- IllegalKeywordArgument
- ImproperConnectionState
-
- CannotSendHeader
- CannotSendRequest
- ResponseNotReady
- IncompleteRead
- NotConnected
- UnimplementedFileMode
- UnknownProtocol
- UnknownTransferEncoding
- HTTPException
-
- BadStatusLine
- IllegalKeywordArgument
- ImproperConnectionState
-
- CannotSendHeader
- CannotSendRequest
- ResponseNotReady
- IncompleteRead
- NotConnected
- UnimplementedFileMode
- UnknownProtocol
- UnknownTransferEncoding
- FakeSocket
- HTTP
-
- HTTPS
- HTTPConnection
-
- HTTPSConnection
- HTTPResponse
class FakeSocket |
| |
|
| |
Methods defined here:
- __getattr__(self, attr)
- __init__(self, sock, ssl)
- makefile(self, mode, bufsize=None)
- Return a readable file-like object with data from socket.
This method offers only partial support for the makefile
interface of a real socket. It only supports modes 'r' and
'rb' and the bufsize argument is ignored.
The returned object contains *all* of the file data
- recv(self, len=1024, flags=0)
- send(self, stuff, flags=0)
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'httplib'
|
class HTTP |
| |
Compatibility class with httplib.py from 1.5. |
| |
Methods defined here:
- __init__(self, host='', port=None)
- Provide a default host, since the superclass requires one.
- _setup(self, conn)
- close(self)
- connect(self, host=None, port=None)
- Accept arguments to set the host/port, since the superclass doesn't.
- getfile(self)
- Provide a getfile, since the superclass' does not use this concept.
- getreply(self)
- Compat definition since superclass does not define it.
Returns a tuple consisting of:
- server status code (e.g. '200' if all goes well)
- server "reason" corresponding to status code
- any RFC822 headers in the response from the server
- putheader(self, header, *values)
- The superclass allows only one value argument.
Data and non-method functions defined here:
- __doc__ = 'Compatibility class with httplib.py from 1.5.'
- __module__ = 'httplib'
- _connection_class = <class httplib.HTTPConnection>
- _http_vsn = 10
- _http_vsn_str = 'HTTP/1.0'
- debuglevel = 0
|
class HTTPConnection |
| |
|
| |
Methods defined here:
- __init__(self, host, port=None)
- _send_request(self, method, url, body, headers)
- _set_hostport(self, host, port)
- close(self)
- Close the connection to the HTTP server.
- connect(self)
- Connect to the host and port specified in __init__.
- endheaders(self)
- Indicate that the last header line has been sent to the server.
- getresponse(self)
- Get the response from the server.
- putheader(self, header, value)
- Send a request header line to the server.
For example: h.putheader('Accept', 'text/html')
- putrequest(self, method, url)
- Send a request to the server.
`method' specifies an HTTP request method, e.g. 'GET'.
`url' specifies the object being requested, e.g. '/index.html'.
- request(self, method, url, body=None, headers={})
- Send a complete request to the server.
- send(self, str)
- Send `str' to the server.
- set_debuglevel(self, level)
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'httplib'
- _http_vsn = 11
- _http_vsn_str = 'HTTP/1.1'
- auto_open = 1
- debuglevel = 0
- default_port = 80
- response_class = <class httplib.HTTPResponse>
|
class HTTPResponse |
| |
|
| |
Methods defined here:
- __init__(self, sock, debuglevel=0)
- _safe_read(self, amt)
- Read the number of bytes requested, compensating for partial reads.
Normally, we have a blocking socket, but a read() can be interrupted
by a signal (resulting in a partial read).
Note that we cannot distinguish between EOF and an interrupt when zero
bytes have been read. IncompleteRead() will be raised in this
situation.
This function should be used when <amt> bytes "should" be present for
reading. If the bytes are truly not available (due to EOF), then the
IncompleteRead exception can be used to detect the problem.
- begin(self)
- close(self)
- getheader(self, name, default=None)
- isclosed(self)
- read(self, amt=None)
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'httplib'
|
class HTTPS(HTTP) |
| |
Compatibility with 1.5 httplib interface
Python 1.5.2 did not have an HTTPS class, but it defined an
interface for sending http requests that is also useful for
https. |
| |
Methods defined here:
- __init__(self, host='', port=None, **x509)
Data and non-method functions defined here:
- __doc__ = 'Compatibility with 1.5 httplib interface\n\n ...hat is also useful for\n https.\n '
- __module__ = 'httplib'
- _connection_class = <class httplib.HTTPSConnection>
- This class allows communication via SSL.
Methods inherited from HTTP:
- _setup(self, conn)
- close(self)
- connect(self, host=None, port=None)
- Accept arguments to set the host/port, since the superclass doesn't.
- getfile(self)
- Provide a getfile, since the superclass' does not use this concept.
- getreply(self)
- Compat definition since superclass does not define it.
Returns a tuple consisting of:
- server status code (e.g. '200' if all goes well)
- server "reason" corresponding to status code
- any RFC822 headers in the response from the server
- putheader(self, header, *values)
- The superclass allows only one value argument.
Data and non-method functions inherited from HTTP:
- _http_vsn = 10
- _http_vsn_str = 'HTTP/1.0'
- debuglevel = 0
|
class HTTPSConnection(HTTPConnection) |
| |
This class allows communication via SSL. |
| |
Methods defined here:
- __init__(self, host, port=None, **x509)
- connect(self)
- Connect to a host on a given (SSL) port.
Data and non-method functions defined here:
- __doc__ = 'This class allows communication via SSL.'
- __module__ = 'httplib'
- default_port = 443
Methods inherited from HTTPConnection:
- _send_request(self, method, url, body, headers)
- _set_hostport(self, host, port)
- close(self)
- Close the connection to the HTTP server.
- endheaders(self)
- Indicate that the last header line has been sent to the server.
- getresponse(self)
- Get the response from the server.
- putheader(self, header, value)
- Send a request header line to the server.
For example: h.putheader('Accept', 'text/html')
- putrequest(self, method, url)
- Send a request to the server.
`method' specifies an HTTP request method, e.g. 'GET'.
`url' specifies the object being requested, e.g. '/index.html'.
- request(self, method, url, body=None, headers={})
- Send a complete request to the server.
- send(self, str)
- Send `str' to the server.
- set_debuglevel(self, level)
Data and non-method functions inherited from HTTPConnection:
- _http_vsn = 11
- _http_vsn_str = 'HTTP/1.1'
- auto_open = 1
- debuglevel = 0
- response_class = <class httplib.HTTPResponse>
|
|