Skip to main content
Module

std/http/negotiation.ts

Deno standard library
Go to Latest
import * as mod from "https://deno.land/std@0.177.0/http/negotiation.ts";

Contains the functions accepts, acceptsEncodings, and acceptsLanguages to provide content negotiation capabilities.

Functions

Returns an array of media types accepted by the request, in order of preference. If there are no media types supplied in the request, then any media type selector will be returned.

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 an array of languages accepted by the request, in order of preference. If there are no languages supplied in the request, then ["*"] is returned, imply any language is accepted.