| Namespace | http://www.mulesoft.org/schema/mule/rest |
|---|---|
| Schema Location | http://www.mulesoft.org/schema/mule/rest/current/mule-rest.xsd (View Schema) |
| Schema Version | 1.0 |
| Minimum Mule Version | 3.2 |
A Mule module for implementing REST APIs whitin flows.
The module includes a custom router that will dispatch the message to the inner message processors as long as the URI matches and the processors are attached to the right HTTP method.| Message Processors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
A REST router is an intercepting message processor that will only execute if the incoming message
contains a http.request.path property that matches the templareUri parameter.
| |||||||||||
To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rest="http://www.mulesoft.org/schema/mule/rest"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/rest
http://www.mulesoft.org/schema/mule/rest/current/mule-rest.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
A REST router is an intercepting message processor that will only execute if the incoming message contains a http.request.path property that matches the templareUri parameter.
An URI template is a URI-like String that contained variables marked of in braces ({, }), which can be expanded to produce a URI.
The following is an example URI template:
/hotels/{hotel}/bookings/{booking}
If the incoming URI matches the template it will extract the variables in it and it will make them available as
properties.
INCLUDE_ERROR
| Name | Default Value | Description |
|---|---|---|
| Optional. Specify which configuration to use. | ||
Template URI string. Variables need to be contained within braces {, }. |
||
| The HTTP method of the request | ||
| The HTTP uri of the request | ||
| The source callback |
| Payload Class | Description |
|---|---|
| UnsupportedHttpVerbException | Thrown when the HTTP method is not available or when the processor to be executed is null. |
| Exception |