Learn R Programming

geckor (version 0.2.0)

build_get_request: Build URLs for GET requests

Description

Returns URLs properly formatted for GET requests

Usage

build_get_request(
  base_url = "https://api.coingecko.com",
  path,
  query_parameters
)

Arguments

base_url

(character): API's base URL (host). Defaults to "https://api.coingecko.com".

path

(character or NULL): vector, whose elements form the path of the respective API endpoint. The order of these elements is important. For example, if the path is api/v3/ping, then this vector must be path = c("api", "v3", "ping").

query_parameters

(named list or NULL): contains parameters of the request.

Value

A URL that is ready to be used in a GET request.

Details

No validation of the base URL is performed by this function, so users are advised to ensure that the base URL is correctly formatted and encoded.