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

std/http/negotiation.ts

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
import * as mod from "https://deno.land/std@0.151.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.