1. Proxies and Flow

return

Version

Terminates the exchange flow. The returned response is determined in the following order:

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 status and contentType will overwrite the values from the messages.

This plugin is useful together with the template plugin. See examples/template.

Syntax

return:
contentType: <string>
status: <number>
return:
  contentType: <string>
  status: <number>

Sample

<api port="2000">
<response>
<static>Hello!</static>
</response>
<return/>
</api>
<api port="2000">
    <response>
        <static>Hello!</static>
    </response>
    <return/>
</api>

Attributes

NameRequiredDefaultDescriptionExamples
contentTypefalsenullContent-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
statusfalse200HTTP status code to be returned.400

Can be used in