Skip to main content
Module

x/attain/mod.ts>Request#acceptsEncodings

Deno API middleware Server
Latest
method Request.prototype.acceptsEncodings
import { Request } from "https://deno.land/x/attain@1.1.2/mod.ts";

Returns an array of encodings, accepted by the requestor, in order of preference. If there are no encodings supplied by the requestor, undefined is returned.

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