Class: Request

Request

Wrapper for the ExpressJS request, exposing only the necessary minimum.


new Request()

Initializes the request.

Members


<nullable> _request :Express.Request

The current ExpressJS request object, or null if running at the client side.

Type:
  • Express.Request

Methods


getBody()

Returns body of request.

Returns:
Type
string

getCookieHeader()

Returns the Cookie HTTP header value.

Returns:

The value of the Cookie header.

Type
string

getFile()

Returns uploaded file to server and meta information.

Returns:
Type
Object.<string, *>

getFiles()

Returns upaloaded files to server with their meta information.

Returns:
Type
Object.<string, *>

getHeader(header)

Returns the specified HTTP request header.

Parameters:
Name Type Description
header string
Returns:
Type
string

getIP()

Returns the remote IP address of the request.

Returns:
Type
string

getIPs()

Returns array of IP addresses specified in the “X-Forwarded-For” request header.

Returns:
Type
Array.<string>

getPath()

Returns the path part of the URL to which the request was made.

Returns:

The path to which the request was made.

Type
string

init(request)

Initializes the request using the provided ExpressJS request object.

Parameters:
Name Type Argument Description
request Express.Request <nullable>

The ExpressJS request object representing the current request. Use null at the client side.