HttpRestClient class
HttpRestClient.Rd
Class providing simple atomic CRUD requests to a particular end_point
Value
a list with success flag, status code of the call and response from the API in JSON format. It will contain the error message in case of error.
a list with success flag, status code of the call and response from the API in a dataframe format. In case of error it will contain the error in JSON format.
a list of lists. Each element in the outer list will contain the the successful or failed response, which object structure is similar to other calls (success, status_code and response in JSON format).
a list with success flag, status code of the call and response from the API in JSON format. It will contain the error message in case of error.
a list with success flag, status code of the call and response from the API in JSON format. It will contain the error message in case of error.
Public fields
base_url
string containing the base url of the querying API (without the end_point) part
token
string to authenticate against the API
headers
list of HTTP headers
Methods
Method get_dataframe()
Gets data from the API and return it in dataframe format. It expects one record per row in the rendered dataframe.
Method post_dataframe()
Post every single row of teh passed dataframe in one-by-one fahsion to the API. It expects a row per record to be sent, therefore it makes nrow() calls to the API. It will not stop until all rows of the dataframe have been walked through.
Method post_object()
Post data to the API. The returned JSON may contain a unique ID generated after the record was registered.
Method delete_object()
Delete a single record identified by the passed field which should be unique.