1. If there is already a response in the exchange, that response is returned 2. If there is no response in the exchange, the body and contentType of the request is copied into a new response.
The options statusCode and contentType will overwrite the values from the messages.
This plugin is useful together with the template plugin. See examples/template.
Name | Required | Default | Description | Example |
---|---|---|---|---|
contentType | false | null |
The content type of the response. If not set, the content type of the request (if available) or no content type will be used.
|
application/json; charset=utf-8 |
statusCode | false | 200 |
The HTTP status code to be returned.
|
400 |