Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.04 KB

File metadata and controls

47 lines (35 loc) · 1.04 KB
code type title description
true
page
configure | Framework | Core
RequestResponse class configure() method

configure

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

Arguments

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

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