Skip to contents

Many APIs provide API keys that can be used to authenticate requests (or, often, provide other information about the user). This function helps to apply those keys to requests.

Usage

security_api_key(req, ..., location = "header")

Arguments

req

A httr2::request() object.

...

Additional parameters depending on the location of the API key.

  • parameter_name ("header" or "query" only) The name of the parameter to use in the header or query.

  • api_key ("header" or "query" only) The API key to use.

  • path ("cookie" only) The location of the cookie.

location

Where the API key should be passed. One of "header" (default), "query", or "cookie".

Value

A httr2::request() object.