API Docs for: HEAD
Show:

Request Class

Represents an incoming client request.

Constructor

Request

(
  • props
)

Parameters:

  • props Object
    • url String

      Request URL

    • method String

      Request method ("GET", "POST", ...)

    • headers Object

      Request headers

    • upgrade Buffer

      Whether or not the request is an upgrade request

    • rawBody Buffer

      Request body, if any

Attributes

body

Parsed request body for common content types (could be a string or an object, depending on the content type). If the content type is not supported or was unparseable, body will be null. JSON bodies and form parameters will become objects, and plain text and HTML will become strings.

bodyParams

Object deprecated

Request body parameters.

getParams

Object deprecated

Request query parameters ("GET" parameters).

headers

Object

Request headers. Note that the header names are Node-style (ie. lowercase).

method

String

Request method, normalised to uppercase.

params

Object

Request URL path captured parameters. Note that this attribute is only available in request objects passed directly by RoboHydra, not in user-created request objects.

When defining URL paths, expressions like :id or :user can be used as part of the regular expression (eg. /save/:id or /:user/preferences). These expressions will match any URL path fragment, and the matched contents will be available in the params object in the request object. For example, if you have a head for path /articles/:articleid/view and you receive a request for /articles/introduction-to-robohydra/view, the request object will have a params property with a single property, articleid with value introduction-to-robohydra.

queryParams

Object

Request query parameters ("GET" parameters).

rawBody

Buffer

Request body. Otherwise, undefined.

url

String

Request URL path, including GET parameters (eg. /foo, /bar/qux, /articles?order=date).