Construct a new Request.
See Request#method.
See Request#originalUrl.
See Request#url.
See Request#headers.
See Request#bodyStream.
See Request#originalIp.
See Request#ip.
See Request#server.
URIError If the request URL path name contains an invalid URI escape sequence.
Readonly
bodyRequest body readable stream.
Readonly
cookiesThe parsed request cookies from the https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cookie|Cookie request header.
Readonly
headersThe request headers.
Readonly
ipIP address of client (first peer). If the request originated from a trusted proxy, this will be the client IP indicated by the proxy. Otherwise, if the proxy specifies no client IP, or the proxy is untrusted, this will be the proxy IP and equivalent to Request#originalIp.
Readonly
methodThe request method.
Readonly
originalThe IP address of the request sender (last peer). This might be a proxy.
Readonly
originalThe original request address, as sent by the last peer. The URL protocol
is always set to http:
and
the host
(and related) are always taken from the HOST
environment variable or defaulted to localhost
.
If basic authentication is available to this request via headers, the username
and password
fields are
available in the URL object.
Readonly
pathThe components of the request URL path name.
Readonly
serverThe Server from which this request was received.
Readonly
urlThe address requested by the client (first peer). If the request originated from a trusted proxy, this address
will be constructed based on protocol and host provided by the proxy. If the proxy does not specify protocol,
http:
will be used as a default. If the proxy does not specify host (or the proxy is not trusted), will use the
Host
request header. If that is not specified either, will use the HOST
environment variable or default to
localhost
.
In short, this is, as closely as possible, the exact URL address the client requested.
If basic authentication is available to this request via headers, the username
and password
fields are
available in the URL object.
Returns a promise that resolves with an ArrayBuffer representation of the request body.
Request.BodyAlreadyConsumedError If the request body has already been consumed.
Require that authorisation can be obtained from this request.
ThrowableResponse of ServerErrorRegistry.ErrorCodes.UNAUTHORISED if authorisation cannot be obtained.
Require that authorisation can be obtained from this request and that the given (requested) permission(s) are ALL within the scope of the authorisation.
The requested permissions.
ThrowableResponse of ServerErrorRegistry.ErrorCodes.UNAUTHORISED if authorisation cannot be obtained.
ThrowableResponse of ServerErrorRegistry.ErrorCodes.NO_PERMISSION if the authorisation lacks any of the requested permissions.
Returns a promise that resolves with a Blob representation of the request body.
Request.BodyAlreadyConsumedError If the request body has already been consumed.
Returns a boolean value that declares whether the body has been read yet.
Returns a promise that resolves with a Uint8Array representation of the request body.
Request.BodyAlreadyConsumedError If the request body has already been consumed.
Returns a promise that resolves with a FormData representation of the request body.
Request.BodyAlreadyConsumedError If the request body has already been consumed.
TypeError If the request body cannot be parsed as multipart.
Attempt to obtain authorisation for this request with one of the Server’s Authenticators.
null
if the request lacks authorisation information.
Returns a promise that resolves with the result of parsing the request body as JSON.
Request.BodyAlreadyConsumedError If the request body has already been consumed.
SyntaxError If the request body cannot be parsed as JSON.
Returns a promise that resolves with a FormData representation of the request body.
Request.BodyAlreadyConsumedError If the request body has already been consumed.
TypeError If the request body cannot be parsed as multipart.
Returns a promise that resolves with a text representation of the request body.
Request.BodyAlreadyConsumedError If the request body has already been consumed.
Static
incomingCreate a new Request from a Node.js incoming HTTP request.
Request.BadUrlError If the request URL is invalid.
Request.SocketClosedError If the request socket was closed before the request could be handled.
An incoming HTTP request from a connected client.