ServerRequest

HTTP. ServerRequest

A server-side request object for handling HTTP requests.

Constructor

new ServerRequest()

Properties:
Name Type Description
httpVersion string

The HTTP version specified in the request.

method string

The HTTP method used for the request

url string

The URL being requested.

headers Object

An object containing the request headers.

Source:

Methods

(async) json() → {Promise.<Object>}

Formats the body to an actual JSON object.

Source:
Returns:
Type:
Promise.<Object>

The body content as JavaScript object.

(async) text() → {Promise.<string>}

Formats the body to a UTF-8 string.

Source:
Returns:
Type:
Promise.<string>

The body content as a UTF-8 string.