RequestResponse #
Kuzzle normalized API response.
It is accessible from the KuzzleRequest.response property. Most of its properties read or write the request they belong to.
This object is mostly meant to be used internally by Kuzzle. To set the response of an action, use configure.
action #
| Type | Description | get / set |
|---|---|---|
string | API action name (null if not set) | get |
collection #
| Type | Description | get / set |
|---|---|---|
string | Collection name (null if not set) | get |
controller #
| Type | Description | get / set |
|---|---|---|
string | API controller name (null if not set) | get |
deprecations #
| Type | Description | get / set |
|---|---|---|
Deprecation[] | Deprecation warnings of the request (undefined when there is none) | get / set |
error #
| Type | Description | get / set |
|---|---|---|
KuzzleError | Request error (null if none). Setting it calls setError | get / set |
headers #
| Type | Description | get / set |
|---|---|---|
JSONObject | Response headers. Reading, writing or deleting a key calls getHeader, setHeader or removeHeader. Holds the X-Kuzzle-Node header by default | get |
index #
| Type | Description | get / set |
|---|---|---|
string | Index name (null if not set) | get |
node #
| Type | Description | get / set |
|---|---|---|
string | Identifier of the Kuzzle node processing the request | get |
raw #
| Type | Description | get / set |
|---|---|---|
boolean | If true, the result is sent as is, instead of being wrapped in a response payload (default: false) | get / set |
requestId #
| Type | Description | get / set |
|---|---|---|
string | Request id | get |
result #
| Type | Description | get / set |
|---|---|---|
any | Request result | get / set |
Setting result calls the deprecated setResult method, which also resets the status to 200. Use configure({ result }) instead.
status #
| Type | Description | get / set |
|---|---|---|
number | Request status | get / set |
volatile #
| Type | Description | get / set |
|---|---|---|
JSONObject | Volatile data of the request (null if not set) | get |