Accepts either a token or a username and password. Timor-Leste authenticates
with basic auth because its KOBO_TOKEN belongs to a user with no data
access to its assets (200 on /assets/<id>/, 404 on /assets/<id>/data/),
while the username and password ingestion already uses work on both. A
country should not need a second credential for this.
Usage
kobo_request(url, token = NULL, username = NULL, password = NULL)
Arguments
- url
Character. The full request URL.
- token
Character. A KoBoToolbox API token, with or without the
Token prefix. Ignored when username is supplied.
- username, password
Character. Basic-auth credentials.
Value
An httr2 request object.
Details
The request never throws on an HTTP error status. KoBoToolbox answers 404
for a submission that has never been validated, which is the normal case, so
the status code has to reach the caller rather than being raised.