...
Name | Default Value | Description |
---|---|---|
|
| HTTP method which should be one of:
|
|
| the The base path which support REST syntax. See further below for examples. |
|
| uri URI template which support REST syntax. See further below for examples. |
|
| media Media type such as: ' By default we accept all kinds of types. |
|
| media Media type such as: ' |
Path and and uriTemplate
syntax
The path and and uriTemplate
option is defined using a REST syntax where you define the REST context path using support for parameters.
Tip |
---|
If no no |
...
The following is a Camel route using a a path only
Code Block | ||
---|---|---|
| ||
from("rest:get:hello") .transform().constant("Bye World"); |
And the following route uses a parameter which is mapped to a Camel header with the key "me
".:
Code Block | ||
---|---|---|
| ||
from("rest:get:hello/{me}") .transform().simple("Bye ${header.me}"); |
...
The following examples have configured a base path as "as hello
" and then have two REST services configured using uriTemplates uriTemplate
's.
Code Block | ||
---|---|---|
| ||
from("rest:get:hello:/{me}") .transform().simple("Hi ${header.me}"); from("rest:get:hello:/french/{me}") .transform().simple("Bonjour ${header.me}"); |
...