Request
import { Request } from "https://raw.githubusercontent.com/mandarineorg/mandarinets/master/deps.ts";
An interface which provides information about the current request.
§Properties
Request remote address. When the application's .proxy
is true, the
X-Forwarded-For
will be used to determine the requesting remote address.
When the application's .proxy
is true
, this will be set to an array of
IPs, ordered from upstream to downstream, based on the value of the header
X-Forwarded-For
. When false
an empty array is returned.
Set to the value of the original Deno server request.
A parsed URL for the request which complies with the browser standards.
When the application's .proxy
is true
, this value will be based off of
the X-Forwarded-Proto
and X-Forwarded-Host
header values if present in
the request.
§Methods
Returns an array of media types, accepted by the requestor, in order of
preference. If there are no encodings supplied by the requestor,
undefined
is returned.
For a given set of media types, return the best match accepted by the
requestor. If there are no encoding that match, then the method returns
undefined
.
Returns an array of charsets, accepted by the requestor, in order of
preference. If there are no charsets supplied by the requestor,
undefined
is returned.
For a given set of charsets, return the best match accepted by the
requestor. If there are no charsets that match, then the method returns
undefined
.
Returns an array of encodings, accepted by the requestor, in order of
preference. If there are no encodings supplied by the requestor,
undefined
is returned.
For a given set of encodings, return the best match accepted by the
requestor. If there are no encodings that match, then the method 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.
Returns an array of languages, accepted by the requestor, in order of
preference. If there are no languages supplied by the requestor,
undefined
is returned.
For a given set of languages, return the best match accepted by the
requestor. If there are no languages that match, then the method returns
undefined
.