260.4. パスおよび uriTemplate 構文
path および uriTemplate オプションは、パラメーターのサポートを使用して REST コンテキストパスを定義する REST 構文で定義します。
TIP: uriTemplate が設定されていないと、path オプションは同じように機能します。パスのみを設定したり、両方のオプションを設定した場合も問題ありません。REST では、パスと uriTemplate の両方を設定するのが一般的な方法です。
以下は、パスのみを使用する Camel ルートです。
from("rest:get:hello") .transform().constant("Bye World");
以下のルートは、キー「me」を持つ Camel ヘッダーにマッピングされるパラメーターを使用します。
from("rest:get:hello/{me}") .transform().simple("Bye ${header.me}");
以下の例では、ベースパスを「hello」として設定し、uriTemplates を使用して 2 つの REST サービスを設定しています。
from("rest:get:hello:/{me}") .transform().simple("Hi ${header.me}"); from("rest:get:hello:/french/{me}") .transform().simple("Bonjour ${header.me}");