Skip to contents

Assembles the HTTP request structure that is common to all Neon Database API requests performed by this package.

Usage

req_basic(
  path,
  method = c("GET", "CONNECT", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT",
    "TRACE"),
  origin = funky::config_val("origin"),
  api_key = funky::config_val("api_key"),
  max_tries = 3L
)

Arguments

path

character(1)
Neon API endpoint path.

method

character(1)
HTTP request method. One of "GET", "CONNECT", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT" or "TRACE".

origin

character(1)
Neon server origin.

api_key

character(1)
API key with sufficient access to the Neon project_id.

max_tries

Maximum number of request attempts in case of an HTTP error. An integerish scalar. Retries are performed using exponential backoff and jitter, see httr2::req_retry() for details.

Value

A modified HTTP request.

See also

Other common functions: api()