callTargomoAPI: Call the Targomo API

Description Usage Arguments Value

View source: R/API.R

Description

Function to wrap aroung httr::POST, sending the request body to the API.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
callTargomoAPI(
  api_key = Sys.getenv("TARGOMO_API_KEY"),
  region = Sys.getenv("TARGOMO_REGION"),
  service,
  body,
  config = list(),
  verbose = FALSE,
  progress = FALSE,
  timeout = NULL
)

Arguments

api_key

The Targomo API key.

region

The Targomo region.

service

The Targomo service - 'polygon', 'route', or 'time'.

body

A request body made with createRequestBody.

config

Config options to pass to httr::POST e.g. proxy settings

verbose

Display info on the API call?

progress

Display a progress bar?

timeout

Timeout in seconds (leave NULL for no timeout/curl default).

Value

A httr response object with the API response (whether successful or not).


cwthom/TargomoR documentation built on Dec. 24, 2019, 7:02 p.m.