I'm trying to invoke rest services from camel using restlest. I need to set some http headers and other application specific headers.
This is the way I'm doing it:
from("timer:50000?repeatCount=1").process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
Message out = exchange.getOut();
Map<String, Object> headers = new HashMap<>();
headers.put(Exchange.CONTENT_TYPE, "application/json");
headers.put("token", "value");
out.setHeaders(headers);
}
})
.to("restlet:https://host:443/api/1/customer?restletMethod=get");
But the resulting http request does not apply the headers at all.
What's wrong with this?
For those who may have the same problem, I've figured it out, finally. I don't use Restlet any longer, but camel-http4 instead.