Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/oauth4webapi/mod.ts>protectedResourceRequest

Low-Level OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
Latest
function protectedResourceRequest
import { protectedResourceRequest } from "https://deno.land/x/oauth4webapi@v3.1.2/mod.ts";

Performs a protected resource request at an arbitrary URL.

Authorization Header is used to transmit the Access Token value.

Parameters

accessToken: string

The Access Token for the request.

method: string

The HTTP method for the request.

url: URL

Target URL for the request.

optional
headers: Headers

Headers for the request.

Request body compatible with the Fetch API and the request's method.

Returns

Promise<Response>

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