Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The HTTP component provides a way to set the HTTP request method by setting the message header. Here is an example;

Camel 1.x

Code Block
from("direct:start")
            .setHeader(HttpConstants.HTTP_METHOD, constant(org.apache.camel.component.http.HttpMethods.POST))
	    .to("http://www.google.com")
            .to("mock:results");

Camel 2.x

Code Block

from("direct:start")
            .setHeader(Exchange.HTTP_METHOD, constant(org.apache.camel.component.http.HttpMethods.POST))
	    .to("http://www.google.com")
            .to("mock:results");

...