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

x/oak_nest/mod.ts>Request#accepts

Refer to nestjs to realize some common functions for Deno
Go to Latest
method Request.prototype.accepts
import { Request } from "https://deno.land/x/oak_nest@v1.13.17/mod.ts";

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