Versions Compared

Key

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

...

In Camel 1.5 the following algorithm is used to determine if either GET or POST http method should be used:
1. Use method provided in header
2. GET is query string is provided in header
3. GET if endpoint is configured with a query string
4. POST if there is data to send (body is not null)
5. GET otherwise

URI

You can set the http producer's URI directly form the endpoint URI. In Camel 1.5.1 you can override the http endpoint URI by adding a header with the key HttpProducer.HTTP_URI on the message.

Code Block

 new RouteBuilder() {
    public void configure() {
        from("direct:start")
            .setHeader(org.apache.camel.component.http.HttpProducer.HTTP_URI, constant("http://newhost"))
	    .to("http://oldhost")
            .to("mock:results");
    }            
};
	    

URI Parameters

The http producer supports URI parameters to be sent to the HTTP server. The URI parameters can either be set directly on the endpoint URI or as a header with the key HttpProducer.QUERY on the message. See samples below.

...