This one should be trivial but somehow it is not working for me. I am trying to make a call to a RESTLET server hosted on Camel. I get it working with Camel client but I am trying to get the same to work with a bare Apache HTTP Client. The Camel is client is as follows:
CamelContext context = new DefaultCamelContext();
Map<String, Object> headers = new HashMap<String, Object>();
context.createProducerTemplate().requestBodyAndHeaders("restlet:http://localhost:8086/Bookmarkee/boolean/V2?restletMethod=post", "Halleluia",headers);
The HTTP Client I am trying to make work is this:
HttpPost httppost = new HttpPost("http://localhost:8086/Bookmarkee/boolean/V2?restletMethod=post");
StringEntity e= new StringEntity("Halleluia",ContentType.create("text/plain", "UTF-8"));
httppost.setEntity(e);
CloseableHttpResponse response = httpclient.execute(httppost);
On the server however, the response is not read from the stream by the servlet engine. Resulting in my component being passed an input stream instead of a string.
Any clue?