Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added the description for how to get response code from http producer

...

In the header value above notice that it should not be prefixed with ? and you can separate parameters as usual with the & char.

Response Code

You can get the http response code from the http component by getting the value from out message header with HttpProducer.HTTP_RESPONSE_CODE.

Code Block
java
java

   Exchange exchange = template.send("http://www.google.com/search", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(HttpProducer.QUERY, constant("hl=en&q=activemq"));
            }
   });
   Message out = exchange.getOut();
   int responseCode = out.getHeader(HttpProducer.HTTP_RESPONSE_CODE, Integer.class);
Include Page
CAMEL:Endpoint See Also
CAMEL:Endpoint See Also