configure #
Available since 2.11.0
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',
});
Edit this page on Github(opens new window)