x/oak/deps.ts

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Very Popular
Go to Latest
function accepts
import { accepts } from "https://dotland-vbqsvsrpfncg.deno-staging.dev/x/oak@v11.1.0/deps.ts?s=accepts";

Returns an array of media types accepted by the request, in order of preference. If there are no media types supplied in the request, then any media type selector will be returned.

Parameters

request: Request[src]

Returns

string[][src]

For a given set of media types, return the best match accepted in the request. If no media type matches, then the function returns undefined.

Parameters

request: Request[src]
...types: string[][src]

Returns

string | undefined[src]