| |
- atom.http_interface.Error(exceptions.Exception)
-
- ProxyError
- atom.http_interface.GenericHttpClient(__builtin__.object)
-
- HttpClient
-
- ProxiedHttpClient
- exceptions.Exception(exceptions.BaseException)
-
- TestConfigurationError
class HttpClient(atom.http_interface.GenericHttpClient) |
| |
- Method resolution order:
- HttpClient
- atom.http_interface.GenericHttpClient
- __builtin__.object
Methods defined here:
- __init__(self, headers=None)
- request(self, operation, url, data=None, headers=None)
- Performs an HTTP call to the server, supports GET, POST, PUT, and
DELETE.
Usage example, perform and HTTP GET on http://www.google.com/:
import atom.http
client = atom.http.HttpClient()
http_response = client.request('GET', 'http://www.google.com/')
Args:
operation: str The HTTP operation to be performed. This is usually one
of 'GET', 'POST', 'PUT', or 'DELETE'
data: filestream, list of parts, or other object which can be converted
to a string. Should be set to None when performing a GET or DELETE.
If data is a file-like object which can be read, this method will
read a chunk of 100K bytes at a time and send them.
If the data is a list of parts to be sent, each part will be
evaluated and sent.
url: The full URL to which the request should be sent. Can be a string
or atom.url.Url.
headers: dict of strings. HTTP headers which should be sent
in the request.
Data and other attributes defined here:
- v2_http_client = None
Methods inherited from atom.http_interface.GenericHttpClient:
- delete(self, url, headers=None)
- get(self, url, headers=None)
- post(self, url, data, headers=None)
- put(self, url, data, headers=None)
Data descriptors inherited from atom.http_interface.GenericHttpClient:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from atom.http_interface.GenericHttpClient:
- debug = False
|
class ProxiedHttpClient(HttpClient) |
|
Performs an HTTP request through a proxy.
The proxy settings are obtained from enviroment variables. The URL of the
proxy server is assumed to be stored in the environment variables
'https_proxy' and 'http_proxy' respectively. If the proxy server requires
a Basic Auth authorization header, the username and password are expected to
be in the 'proxy-username' or 'proxy_username' variable and the
'proxy-password' or 'proxy_password' variable, or in 'http_proxy' or
'https_proxy' as "protocol://[username:password@]host:port".
After connecting to the proxy server, the request is completed as in
HttpClient.request. |
|
- Method resolution order:
- ProxiedHttpClient
- HttpClient
- atom.http_interface.GenericHttpClient
- __builtin__.object
Methods inherited from HttpClient:
- __init__(self, headers=None)
- request(self, operation, url, data=None, headers=None)
- Performs an HTTP call to the server, supports GET, POST, PUT, and
DELETE.
Usage example, perform and HTTP GET on http://www.google.com/:
import atom.http
client = atom.http.HttpClient()
http_response = client.request('GET', 'http://www.google.com/')
Args:
operation: str The HTTP operation to be performed. This is usually one
of 'GET', 'POST', 'PUT', or 'DELETE'
data: filestream, list of parts, or other object which can be converted
to a string. Should be set to None when performing a GET or DELETE.
If data is a file-like object which can be read, this method will
read a chunk of 100K bytes at a time and send them.
If the data is a list of parts to be sent, each part will be
evaluated and sent.
url: The full URL to which the request should be sent. Can be a string
or atom.url.Url.
headers: dict of strings. HTTP headers which should be sent
in the request.
Data and other attributes inherited from HttpClient:
- v2_http_client = None
Methods inherited from atom.http_interface.GenericHttpClient:
- delete(self, url, headers=None)
- get(self, url, headers=None)
- post(self, url, data, headers=None)
- put(self, url, data, headers=None)
Data descriptors inherited from atom.http_interface.GenericHttpClient:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from atom.http_interface.GenericHttpClient:
- debug = False
|
|