call_api: Call a Comet REST API endpoint

Description Usage Arguments Value

View source: R/api.R

Description

This function is only meant for advanced users. If you would like to call any arbitrary Comet API endpoint that isn't natively supported by cometr, you can use this function.

Usage

1
2
3
4
5
6
7
call_api(
  endpoint,
  method = c("GET", "POST"),
  params = list(),
  response_json = TRUE,
  api_key = NULL
)

Arguments

endpoint

The REST API endpoint.

method

The HTTP method to use, either "GET" or "POST".

params

A list of parameters. For GET endpoints, the parameters are appended to the URL; for POST endpoints, the parameters are sent in the body of the request.

response_json

If TRUE, try to parse the response as JSON. If FALSE, return the response as raw data (useful when the response is a file).

api_key

Comet API key (can also be specified using the COMET_API_KEY parameter as an environment variable or in a comet config file).

Value

The parsed response


daattali/cometr documentation built on Aug. 15, 2020, 4:53 a.m.