Function: protectedResourceRequest()
August 29, 2025 ยท View on GitHub
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
| Parameter | Type | Description |
|---|---|---|
accessToken | string | The Access Token for the request. |
method | string | The HTTP method for the request. |
url | URL | Target URL for the request. |
headers? | Headers | Headers for the request. |
body? | ProtectedResourceRequestBody | Request body compatible with the Fetch API and the request's method. |
options? | ProtectedResourceRequestOptions | - |
Returns
Resolves with a Response instance. WWW-Authenticate HTTP Header challenges are rejected with WWWAuthenticateChallengeError.