Can be used in
The following imports are automatically added to your script.
import static com.predic8.membrane.core.interceptor.Outcome.* import com.predic8.membrane.core.http.*
The following variables can be accessed within a script.
|The Exchange class provides, among others, access to the Request, Response and their corresponding Headers.
|Message is the superclass of a request or a response. Depending on the flow the message contains data from the request or the response.
|The header object allows access to the HTTP header fields. You can remove, add and change fields.
|The body of the message.
|If the message contains a body of the type application/json this varible will contain the JSON as a Map. Use it only to read the JSON document.
|REQUEST or RESPONSE
|The properties of the exchange object.
|The Spring application context hosting the router instance (or null, if the router is not hosted by Spring).
A script can return a value that is put into the message body or the value can influence the processing of an exchange.
|The map is converted into JSON and put into the message body.
|The response is put into the exchange and the flow returns to the client.
|The enumeration controls the flow of the exchange. With CONTINUE the processing goes on. With RETURN the flow is returned to the client. And ABORT terminates with an error.
|CONTINUE, RETURN, ABORT
|Puts the string into the message body and continues.