Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/hex/src/fw/service/deps.ts>oak.Request#acceptsEncodings

An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Latest
method oak.Request.prototype.acceptsEncodings
import { oak } from "https://deno.land/x/hex@0.6.5/src/fw/service/deps.ts";
const { Request } = oak;

Returns an array of encodings, accepted by the requestor, in order of preference. If there are no encodings supplied by the requestor, then ["*"] is returned, matching any.

Returns

string[] | undefined

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

NOTE: You should always supply identity as one of the encodings to ensure that there is a match when the Accept-Encoding header is part of the request.

Parameters

...encodings: string[]

Returns

string | undefined