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
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).


TargomoR documentation built on Dec. 7, 2019, 1:07 a.m.