Generate base request

This function takes a url and creates a basic httr2 request that adds the user-agent and adds an authorization token to the X-Esri-Authorization header.

Usage

arc_base_req(
  url,
  token = NULL,
  path = NULL,
  query = NULL,
  error_call = rlang::caller_env()
)

Arguments

url

a valid url that is passed to httr2::request()

token

an object of class httr2_token as generated by auth_code() or related function

path

a character vector of paths to be appended to url using httr2::req_url_path_append()

query

a named vector or named list of query parameters to be appended to the url using httr2::req_url_query()

error_call

the caller environment to be used when propagating errors.

Examples

arc_base_req("https://arcgis.com")
#> <httr2_request>
#> GET https://arcgis.com
#> Body: empty
#> Options:
#>useragent: 'arcgisutils v0.3.1'

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close