Core
Framework v2.x
2

configure #

Available since 2.11.0

Allows to configure how the API response should be sent to the requesting client.

Arguments #

Copied to clipboard!
configure(
  options: {
    headers?: JSONObject,
    status?: number,
    format?: 'standard' | 'raw'
  }): void;

The options object may contain the following properties:

Name Type Description
(default)
headers
JSONObject
(null)
Additional response protocol headers
status
integer
(200)
KuzzleRequest status code, following the HTTP standard
format
string
(null)
The response format, as a standard Kuzzle response or in a unwrapped raw format instead

Example #

Copied to clipboard!
request.response.configure({
  headers: {
    'Location': 'http://kuzzle.io'
  },
  status: 302,
  format: 'raw',
});