This function is the foundation of all communication with the api in this package. Not intended for end-users, but it provides all the flexibility of the api without the nice conveniences of the other functions in this package. By default it reformats the api response (which is json) to a list object.
dawa(
section,
...,
append_to_url = NULL,
format = NULL,
verbose = TRUE,
cache = TRUE,
dry_run = FALSE,
func_params = list()
)
By default returns the API response as a list output. For
geojson(z)
formats it returns the raw json. When dry_run = TRUE
it
returns the request that has been created but does not run it.
Defines what section of the api should be called.
available_sections()
exposes all options for this parameter.
<dynamic-dots
> input query parameters.
This options enables you to append a string to the url.
It is inserted in the request after the section
but before the ...
.
The format to provide as a query parameter for the api call. By
default it has value NULL
and triggers default json formatting. When
geojson
or geojsonz
is provided, the function will return the raw json
data instead of the usual list.
whether or not to provide {cli}
output for the user. Enabled
by default, but disabled for all functions that wrap this function
Option to use caching in a tempdir()
. Enabled by default. More
info can be found in the documentation for httr2::req_cache()
.
With this option enabled, the function will output the request that has been created - Without sending it to the api. This is useful for debugging.
Option to include extra parameters (just like ...
above). This option is used to pass down the dot-inputs from get_data()
and get_map_data()
. It is recommended to use the dynamic dots instead of
this option, as an end user.
if (connection_check()) {
x <- dawa(section = "sogne")
x[[1]]
}
Run the code above in your browser using DataLab