Adds OSF auth and accept headers to an httr2 request.
Arguments
- req
an httr2 request object
- pat
an OSF personal access token to authorise the request with. Defaults to the token set by
osf_pat(), which falls back to theOSF_PATenvironment variable (normally set in.Renviron), left out when the OSF refuses it (seeapi_key_status())..osf_headers()is passed bare as a request configurator in several places (e.g. as.batch_query(req_func = )), so a token supplied for a whole run is set withosf_pat()rather than threaded through every call site. Namedpatrather thanosf_patbecause an argument of that name would shadow theosf_pat()function supplying its own default.
