Name

Restlet — provides Restlet-based endpoints for consuming and producing RESTful resources

URI format

The URI format for a Restlet endpoint is:

restlet:http://hostname[:port][/resourcePattern][?options]

The default port is port 80.

Options

Table 27, “Restlet endpoint options” lists the options for a Servlet endpoint.

Table 27. Restlet endpoint options

NameDefaultDescription
headerFilterStrategy Specifies the bean ID of a header filter strategy in the registry. The strategy will be plugged into the restlet binding if it is HeaderFilterStrategyAware.
restletBinding Specifies the bean ID of a RestletBinding object in the registry.
restletMethodGETOn a producer endpoint, specifies the request method to use. On a consumer endpoint, specifies that the endpoint consumes only restletMethod requests.
restletMethods Consumer only: Specifies one or more methods separated by commas to be serviced by a restlet consumer endpoint. restletMethods takes president over restletMethod.
restletUriPatterns Consumer only: Specifies one ore more URI templates to be serviced by a restlet consumer endpoint using the # notation to reference a List<String> in the registry. If a URI pattern has been defined in the endpoint URI, both the URI pattern defined in the endpoint and the restletUriPatterns option will be honored.

Message headers

Restlet endpoints use the following message headers:

NameTypeDescription
CamelContentTypeStringSpecifies the content type of the response message. If this header is not set, the content type is based on the object type of the OUT message body. If the content type is specified in the IN message, that value determines the content type for the Restlet request message. Otherwise, the content type is defaulted to application/x-www-form-urlencoded.
CamelHttpMethodStringSpecifies the HTTP request method. This is set in the IN message header.
CamelHttpQueryStringSpecifies the query string of the request URI. It is set on the IN message the endpoint receives a request.
CamelHttpResponseCodeString or IntegerSpecifies the response code to set on the OUT message by the application/processor. The value is the response code of the response message. If this header is not set, the response code is set by the restlet runtime engine.
CamelHttpUriStringSpecifies the HTTP request URI. This is set in the IN message header.
CamelRestletLoginStringSpecifies the login name for basic authentication. It is set on the IN message by the application and gets filtered before the restlet request header.
CamelRestletPasswordStringSpecifies the password for basic authentication. It is set on the IN message by the application and gets filtered before the restlet request header.
org.restlet.* Specifies the attributes of a Restlet message that get propagated to Apache Camel IN headers.

Message Body

Apache Camel will store the restlet response from the external server on the OUT body. All headers from the IN message will be copied to the OUT message, so that headers are preserved during routing.

Related topics

The Restlet Project