You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Harish Kumar <ha...@tcs.com> on 2015/05/06 11:01:59 UTC

Request body is empty in HTTP Endpoint

Am forwarding queue data to a REST Url which is running in a remote location

When I do, the request body is empty. *{}*


This is the route spec
from("test-jms:queue:test.queue")
                 .setHeader(Exchange.HTTP_METHOD,constant("POST"))
                 .setHeader(Exchange.CONTENT_TYPE,constant("text/xml"))				 
			
.to("http://localhost:8080/test?bridgeEndpoint=true&throwExceptionOnFailure=false&disableStreamCache=true&enableMultipartFilter=false");



--
View this message in context: http://camel.465427.n5.nabble.com/Request-body-is-empty-in-HTTP-Endpoint-tp5766738.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Request body is empty in HTTP Endpoint

Posted by Harish Kumar <ha...@tcs.com>.
Ok. Found out the issue. AM sending plain text data, but my rest service is
parsing it as JSON and was showing empty JSON

So just make sure these two

1. In camel, add Content-Type
*.setHeader(Exchange.CONTENT_TYPE,constant("text/html"))				 *

2. In your Rest service accept *text/html*



--
View this message in context: http://camel.465427.n5.nabble.com/Request-body-is-empty-in-HTTP-Endpoint-tp5766738p5766742.html
Sent from the Camel - Users mailing list archive at Nabble.com.