Skip to main content

@std/http@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score70%
Published2 years ago (0.215.0)

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

Functions

f
accepts(
request: Request,
...types: string[]
): string | string[] | undefined
2 overloads

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.

f
acceptsEncodings(
request: Request,
...encodings: string[]
): string | string[] | undefined
2 overloads

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.

f
acceptsLanguages(
request: Request,
...langs: string[]
): string | string[] | undefined
2 overloads

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.

Type Aliases

T
Request = { headers: { get(key: string): string | null; }; }

Loose copy of Request.

  • headers: { get(key: string): string | null; }
    No documentation available

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/http

Import symbol

import * as mod from "@std/http/negotiation";
or

Import directly with a jsr specifier

import * as mod from "jsr:@std/http/negotiation";