Generic function to make API calls

call_that_api(
  api_connection,
  endpoint,
  request = NULL,
  headers = list(),
  action = c("GET", "POST", "PUT"),
  ...
)

Arguments

api_connection

A call_that_connection object.

endpoint

A character variable with containing the endpoint's name.

request

The body or query sent to the REST API.

headers

A list object containing a named list of headers to pass to the API.

action

The action to request from the API. Supported today are: GET, POST and PUT.

...

Other arguments to pass to the REST API call.

Details

It provides a single interface to perform the different calls to an API, such as GET or POST. This function is meant to be used by developers who which to extend callthat to integrate with other API server types.