KuzzleRequest #

The KuzzleRequest class represents a request processed by Kuzzle.

It contains every information used internally by Kuzzle to process the request like the client inputs, but also the response that will be sent back to the client.

This object is received by the controller's actions handler function and it's also the payload of many internal events (e.g API Events)

context #

TypeDescriptionget / set
RequestContext
KuzzleRequest context (e.g. user, connection, jwt)get

deprecations #

TypeDescriptionget / set
Deprecation[]
Array of deprecation warnings associated to the request (undefined when there is none)get / set

error #

TypeDescriptionget / set
KuzzleError
One of the API Error or nullget

Use setError and clearError to change it.

id #

TypeDescriptionget / set
string
KuzzleRequest external unique identifierget / set

Correspond to the requestId property passed in the RequestPayload.

input #

TypeDescriptionget / set
RequestInput
KuzzleRequest arguments and bodyget

internalId #

TypeDescriptionget / set
string
KuzzleRequest internal unique identifierget

response #

TypeDescriptionget / set
RequestResponse
KuzzleRequest response objectget

result #

TypeDescriptionget / set
any
KuzzleRequest result (null until one is set)get

This property is read-only, and the request object is sealed: request.result = value throws a TypeError. To set the result, use request.response.configure({ result }).

status #

TypeDescriptionget / set
number
KuzzleRequest HTTP status (102 until a result or an error is set). The setter only accepts integersget / set

timestamp #

TypeDescriptionget / set
number
KuzzleRequest timestamp, in milliseconds since Epoch (Date.now() when the request is created, unless the request payload provides one)get