I have a camel route configured for reading from a JMS queue and POST it to a
service. My route is :

from("jms:queue")
.marshal()
.json(JsonLibrary.GSON)
.setHeader(Exchange.CONTENT_TYPE,constant("application/json"))
.setHeader(Exchange.HTTP_METHOD, constant("POST"))
.process(new Processor1())
.to("https4:xxxxxx?throwExceptionOnFailure=false")
.process(new MyProcessor());

My Configuration for setting my auth details.

HttpComponent httpc =
getContext().getComponent("http4",HttpComponent.class);
httpc.setHttpConfiguaration(customHttpConfig())

*I am getting a 400 error from the server. But i am able to hit the server
from Postman api and get successful response.*

In my Processor1 class ( before making the request), i am able to print the
body of the message, which contains a json representation of my object.

But in the processor after the POST request, i am doing this and getting
below responses:

Message in = exchange.getIn();
in.getBody(String.class); // print the error code 400
HttpServletRequest request = in.getBody(HttpServletRequest.class)// This is
null.

Anything i am doing wrong? Do i need to set the message Content to the body
of my Post Request?




--
View this message in context: 
http://camel.465427.n5.nabble.com/Http-post-Request-returns-400-error-tp5788101.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to