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

x/ayonli_jsext/esm/http/util.js

A JavaScript extension package for building strong and modern applications.
Latest
import * as ayonliJsext from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/http/util.js";

Functions

Gets the cookie by the given name from the Cookie header of the request or the Set-Cookie header of the response.

Gets the cookies from the Cookie header of the request or the Set-Cookie header of the response.

Checks if the value from the If-Match header matches the given ETag.

Checks if the value from the If-None-Match header matches the given ETag.

Parses the Accept, Accept-Encoding and Accept-Language headers.

Parses the Authorization header with the Basic scheme.

Parses the Content-Type header.

Parses the Set-Cookie header.

Parses the Cookie header or the document.cookie property.

Parses the Range header.

Parses the text message as an HTTP request.

Parses the text message as an HTTP response.

Parses the User-Agent header or the navigator.userAgent property.

Sets a cookie in the Set-Cookie header of the response.

Sets the Content-Disposition header with the given filename when the response is intended to be downloaded.

Converts a Cookie object to a string.

Converts a list of cookies to a string that can be used in the Cookie header.

Converts the request object to text format.

Converts the response object to text format.

Gets the suggested response type for the request.

Performs basic authentication verification for the request. When passed, this function returns nothing (undefined), otherwise it returns a Response with status 401 Unauthorized, which should be responded to the client.