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

x/superdeno/test/deps.ts>Oak.Request#accepts

Super-agent driven library for testing Deno HTTP servers.
Go to Latest
method Oak.Request.prototype.accepts
import { Oak } from "https://deno.land/x/superdeno@4.8.0/test/deps.ts";
const { Request } = Oak;

Returns an array of media types, accepted by the requestor, in order of preference. If there are no encodings supplied by the requestor, then accepting any is implied is returned.

Returns

string[] | undefined

For a given set of media types, return the best match accepted by the requestor. If there are no encoding that match, then the method returns undefined.

Parameters

...types: string[]

Returns

string | undefined