code | type | title | description |
---|---|---|---|
true |
page |
configure | Framework | Core |
RequestResponse class configure() method |
Allows to configure how the API response should be sent to the requesting client.
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 |
request.response.configure({
headers: {
'Location': 'http://kuzzle.io'
},
status: 302,
format: 'raw',
});