| |
Methods defined here:
- Delete = delete(self, uri=None, auth_token=None, http_request=None, **kwargs)
- Get = get(self, uri=None, auth_token=None, http_request=None, **kwargs)
- ModifyRequest = modify_request(self, http_request)
- Post = post(self, uri=None, data=None, auth_token=None, http_request=None, **kwargs)
- Put = put(self, uri=None, data=None, auth_token=None, http_request=None, **kwargs)
- Request = request(self, method=None, uri=None, auth_token=None, http_request=None, **kwargs)
- __init__(self, http_client=None, host=None, auth_token=None, source=None, xoauth_requestor_id=None, **kwargs)
- Creates a new AtomPubClient instance.
Args:
source: The name of your application.
http_client: An object capable of performing HTTP requests through a
request method. This object is used to perform the request
when the AtomPubClient's request method is called. Used to
allow HTTP requests to be directed to a mock server, or use
an alternate library instead of the default of httplib to
make HTTP requests.
host: str The default host name to use if a host is not specified in the
requested URI.
auth_token: An object which sets the HTTP Authorization header when its
modify_request method is called.
- delete(self, uri=None, auth_token=None, http_request=None, **kwargs)
- Performs a request using the DELETE method, returns an HTTP response.
- get(self, uri=None, auth_token=None, http_request=None, **kwargs)
- Performs a request using the GET method, returns an HTTP response.
- modify_request(self, http_request)
- Changes the HTTP request before sending it to the server.
Sets the User-Agent HTTP header and fills in the HTTP host portion
of the URL if one was not included in the request (for this it uses
the self.host member if one is set). This method is called in
self.request.
Args:
http_request: An atom.http_core.HttpRequest() (optional) If one is
not provided, a new HttpRequest is instantiated.
Returns:
An atom.http_core.HttpRequest() with the User-Agent header set and
if this client has a value in its host member, the host in the request
URL is set.
- post(self, uri=None, data=None, auth_token=None, http_request=None, **kwargs)
- Sends data using the POST method, returns an HTTP response.
- put(self, uri=None, data=None, auth_token=None, http_request=None, **kwargs)
- Sends data using the PUT method, returns an HTTP response.
- request(self, method=None, uri=None, auth_token=None, http_request=None, **kwargs)
- Performs an HTTP request to the server indicated.
Uses the http_client instance to make the request.
Args:
method: The HTTP method as a string, usually one of 'GET', 'POST',
'PUT', or 'DELETE'
uri: The URI desired as a string or atom.http_core.Uri.
http_request:
auth_token: An authorization token object whose modify_request method
sets the HTTP Authorization header.
Returns:
The results of calling self.http_client.request. With the default
http_client, this is an HTTP response object.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- auth_token = None
- host = None
- ssl = False
- xoauth_requestor_id = None
|