Function: protectedResourceRequest()

August 29, 2025 ยท View on GitHub

๐Ÿ’— Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.


โ–ธ protectedResourceRequest(accessToken, method, url, headers?, body?, options?): Promise<Response>

Performs a protected resource request at an arbitrary URL.

Authorization Header is used to transmit the Access Token value.

Parameters

ParameterTypeDescription
accessTokenstringThe Access Token for the request.
methodstringThe HTTP method for the request.
urlURLTarget URL for the request.
headers?HeadersHeaders for the request.
body?ProtectedResourceRequestBodyRequest body compatible with the Fetch API and the request's method.
options?ProtectedResourceRequestOptions-

Returns

Promise<Response>

Resolves with a Response instance. WWW-Authenticate HTTP Header challenges are rejected with WWWAuthenticateChallengeError.

See