Author: buildbot Date: Thu Aug 7 07:18:12 2014 New Revision: 918615 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/rest.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/rest.html ============================================================================== --- websites/production/camel/content/rest.html (original) +++ websites/production/camel/content/rest.html Thu Aug 7 07:18:12 2014 @@ -87,17 +87,31 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="Rest-RestComponent">Rest Component</h2><p><strong>Available as of Camel 2.14</strong></p><p>The rest component allows to define REST endpoints using the <a shape="rect" href="rest-dsl.html">Rest DSL</a> and plugin to other Camel components as the REST transport.</p><p> </p><h3 id="Rest-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ rest://verb:path?[options] +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ rest://method:path[:uriTemplate]?[options] ]]></script> -</div></div><h3 id="Rest-URIOptions"><span style="line-height: 1.5625;font-size: 16.0px;">URI Options</span></h3><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default Value </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> verb </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> get, post, put, patch, delete, head, trace, connect, or options. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> path </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> the content path which support REST syntax. See further below for examples. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> consumes </p ></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td >colspan="1" rowspan="1" class="confluenceTd"><p> accept type such as: >'text/xml', or 'application/json'. By default we accept all kinds of types. ></p></td></tr></tbody></table> -<h3 id="Rest-Pathsyntax">Path syntax</h3><p>The path option is defined using a REST syntax where you define the REST context path using support for parameters. </p><p>The following is a Camel route using a fixed path</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h3 id="Rest-URIOptions"><span style="line-height: 1.5625;font-size: 16.0px;">URI Options</span></h3><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default Value </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> method </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> HTTP method which should be one of: get, post, put, patch, delete, head, trace, connect, or options. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> path </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> the base path which support REST syntax. See further below for examples. </p></td></tr><tr><td colspan="1" rowspan="1" cl ass="confluenceTd"><p> uriTemplate </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> uri template which support REST syntax. See further below for examples. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> consumes </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> media type such as: 'text/xml', or 'application/json' this REST service accepts. By default we accept all kinds of types. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> produces </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> media type such as: 'text/xml', or 'application/json' this REST service returns. </p></td></tr></tbody></table> +<h3 id="Rest-PathanduriTemplatesyntax">Path and uriTemplate syntax</h3><p>The path and uriTemplate option is defined using a REST syntax where you define the REST context path using support for parameters. </p> <div class="aui-message success shadowed information-macro"> + <span class="aui-icon icon-success">Icon</span> + <div class="message-content"> + <p>If no uriTemplate is configured then path option works the same way. It does not matter if you configure only path or if you configure both options. Though configuring both a path and uriTemplate is a more common practice with REST.</p> + </div> + </div> +<p> </p><p>The following is a Camel route using a a path only</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("rest:get:hello") .transform().constant("Bye World");]]></script> </div></div><p>And the following route uses a parameter which is mapped to a Camel header with the key "me".</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("rest:get:hello/{me}") .transform().simple("Bye ${header.me}");]]></script> -</div></div><h3 id="Rest-Moreexamples"><span style="line-height: 1.5625;">More examples</span></h3><p>There is a <strong>camel-example-spark-rest-tomcat</strong> example in the Apache Camel distribution, that demonstrates how to use the <a shape="rect" href="rest-dsl.html">Rest DSL</a> with the <a shape="rect" href="spark-rest.html">Spark-rest</a> as transport<span style="line-height: 1.4285715;"> that can be deployed on Apache Tomcat, or similar web containers.</span></p><p></p><h3 id="Rest-SeeAlso">See Also</h3> -<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul style="list-style-type: square;"><li><a shape="rect" href="rest-dsl.html">Rest DSL</a></li><li><a shape="rect" href="spark-rest.html">Spark-rest</a></li></ul></div> +</div></div><p><span style="line-height: 1.5625;"><br clear="none"></span></p><p><span style="line-height: 1.5625;">The following examples have configured a base path as "hello" and then have two REST services configured using uriTemplates.</span></p><p><span style="line-height: 1.5625;"> </span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("rest:get:hello:/{me}") + .transform().simple("Hi ${header.me}"); +Â + from("rest:get:hello:/french/{me}") + .transform().simple("Bonjour ${header.me}"); + +]]></script> +</div></div><h3 id="Rest-Moreexamples"><span style="line-height: 1.5625;font-size: 16.0px;">More examples</span></h3><p><span style="line-height: 1.5625;">See <a shape="rect" href="rest-dsl.html">Rest DSL</a> which offers more examples and how you can use the Rest DSL to define those in a nicer RESTful way.</span></p><p>There is a <strong>camel-example-servlet-rest-tomcat</strong> example in the Apache Camel distribution, that demonstrates how to use the <a shape="rect" href="rest-dsl.html">Rest DSL</a> with <a shape="rect" href="servlet.html">SERVLET</a> as transport<span style="line-height: 1.4285715;"> that can be deployed on Apache Tomcat, or similar web containers.</span></p><p></p><h3 id="Rest-SeeAlso">See Also</h3> +<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul style="list-style-type: square;"><li><a shape="rect" href="rest-dsl.html">Rest DSL</a></li><li><a shape="rect" href="servlet.html">SERVLET</a></li></ul></div> </td> <td valign="top"> <div class="navigation">