Internal helper used by the API wrappers. Builds an httr2 request
against the resolved base URL, performs it, and parses the JSON body.
Centralises the boilerplate so each wrapper only declares the path,
method, and optional query/body.
Usage
daggle_request(
path,
method = c("GET", "POST", "DELETE", "PATCH"),
query = NULL,
body = NULL,
simplify = FALSE,
base_url = NULL
)Arguments
- path
Character vector of URL path segments appended after the base URL via
httr2::req_url_path_append(). Example:c("api", "v1", "dags", name, "runs", run_id).- method
HTTP method. One of
"GET","POST","DELETE","PATCH".- query
Named list of query parameters, or
NULL. Elements whose value isNULLare dropped (so callers can pass optional filters without conditional wiring).- body
Named list serialised as a JSON request body, or
NULL.- simplify
Passed to
httr2::resp_body_json()assimplifyVector. SetTRUEfor collection endpoints that should return a data.frame; leaveFALSEfor single-object endpoints that should return a list.- base_url
Character string or
NULL. Passed toresolve_base_url().
