redivis$make_api_request
Last updated
Was this helpful?
Last updated
Was this helpful?
Initiates an authenticated HTTP request to the .
If parse_response=TRUE
(the default) the result will be a named list corresponding to the API endpoint's JSON response, or None
if the response is empty. Otherwise, returns a object.
In most cases, you should use the various other methods in the redivis python library, rather than interfacing with the API directly, as these methods are far more user-friendly and cover the vast majority of the REST API.
However, in certain advanced cases, it may make sense to call API endpoint directly through this method.
method
: str {"GET" | "POST" | "PATCH" | "PUT" | "HEAD" | "DELETE" }, default "GET"
The HTTP method of the request. Defaults to "GET"
path
: str, default ""
The API path, including the leading forward slash. E.g.: "/organizations/demo/datasets"
query
: list
An optional named list of query parameters to add to the path
payload
: list
An optional payload to include with the request. Must be a named list that will be converted to a JSON string.
parse_response
: bool, default TRUE
Whether to parse the API JSON response into a named list. Typically should be set to TRUE, unless the API endpoint doesn't return JSON.
stream_callback
: function
For advanced use cases. If provided, the response will by streamed in binary chunks passed to the stream_callback function.
list | NULL