Package schrodinger :: Package application :: Package pldb :: Package packages :: Package pldbclient :: Module api_client :: Class ApiClient
[hide private]
[frames] | no frames]

Class ApiClient

object --+
         |
        ApiClient

Class to handle HTTP verbs

Instance Methods [hide private]
 
__init__(self, endpoint, username, password)
x.__init__(...) initializes x; see help(type(x)) for signature
 
invoke_request(self, service_path, path, http_method, headers=None, params=None, data=None, files=None, stream=False)
Make a general request to the PLDB Server

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, endpoint, username, password)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

invoke_request(self, service_path, path, http_method, headers=None, params=None, data=None, files=None, stream=False)

 

Make a general request to the PLDB Server

Parameters:
  • service_path (string) - The base path for the REST resource to be called
  • path (string) - A string that is the addition to the PLDB Base REST URL specifying the method (e.g. '/structures')
  • http_method (requests.get or requests.post, etc) - The requests HTTP request method used to invoked the request
  • params (dict) - A dict mapping query string parameters to their respective values (default: {})
  • data (dict or string) - POST params (dict or plain string)
  • files (dict) - A dict mapping the file type to the respective file handle
  • stream (bool) - Set True to stream content downloads for e.g. large files or binary data (default: False)
Returns:
The JSON-loaded response from the server, with no alterations
Raises:
  • requests.exceptions.HTTPError - if request fails