Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: CAMEL-2453

...

Name

Type

Description

Exchange.HTTP_URI

String

URI to call. Will override existing URI set directly on the endpoint.

Exchange.HTTP_PATH

String

Request URI's path.

Exchange.HTTP_QUERY

String

URI parameters. Will override existing URI parameters set directly on the endpoint.

Exchange.HTTP_RESPONSE_CODE

int

The HTTP response code from the external server. Is 200 for OK.

Exchange.HTTP_CHARACTER_ENCODING

String

Character encoding.

Exchange.CONTENT_TYPE

String

The HTTP content type. Is set on both the IN and OUT message to provide a content type, such as text/html.

Exchange.CONTENT_ENCODING

String

The HTTP content encoding. Is set on both the IN and OUT message to provide a content encoding, such as gzip.

Exchange.HTTP_SERVLET_REQUEST

HttpServletRequest

From Camel 2.3.0, you can get the HttpServletRequest object from the message header,

Exchange.HTTP_SERVLET_RESPONSE

HttpServletResponse

From Camel 2.3.0, you can get the HttpServletResponse object from the message header.

Message Body

Camel will store the HTTP response from the external server on the OUT body. All headers from the IN message will be copied to the OUT message, so headers are preserved during routing. Additionally Camel will add the HTTP response headers as well to the OUT message headers.

...

You can get access to these two using the Camel type converter system using
NOTE from Camel 2.3.0 you can get the request and response not just from the processor after the camel-jetty or camel-cxf endpoint.

Code Block
Code Block
HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class);
HttpServletRequest response = exchange.getIn().getBody(HttpServletResponse.class);

Or you can get access to them from HttpMessage directly using a type cast:

Code Block

HttpMessage msg = (HttpMessage) exchange.getIn();
HttpServletRequest request = msg.getRequest();
HttpServletRequest response = msg.getResponse();

Configuring URI to call

...