Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fsrouter/deps.ts>http.acceptsEncodings

A file system based router for Deno.
Go to Latest
function http.acceptsEncodings
import { http } from "https://deno.land/x/fsrouter@2.11.1/deps.ts";
const { acceptsEncodings } = http;

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

Returns

string[]

For a given set of content encodings, return the best match accepted in the request. If no content encodings match, then the function 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

request: Request
...encodings: string[]

Returns

string | undefined