You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by souciance <so...@gmail.com> on 2015/11/11 17:28:08 UTC

Camel jetty response body

Hello,

I am using the REST dsl to define a simple HTTP POST using Jetty as the
underlying component.

The message is sent to another route which simply logs and returns:

<transform><constant>OK</constant></transform>

Everything works ok but when I test this with fiddler or run a unit test,
the OK part is surrounded with quotes. The response is "OK". 

Note, that the request is a JSON and I suspect it is trying to convert the
message to a json but why? How can I remove the quotes?

Thanks
Souciance



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-jetty-response-body-tp5773652.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel jetty response body

Posted by souciance <so...@gmail.com>.
I figured out what the problem is.

In the REST DSL I turned bindingMode off like:
  <post uri="/postobject" bindingMode="off">

Then it worked. I could get the response back as OK instead of "OK" with
quotes.

Even with bindingMode set to auto, I would get "OK" instead of OK. 

I am not sure if this is a bug or not, at least with bindingMode set to auto
it should not try to convert my response which is just plain string to a
json. I have set the content-type to be text/plain.

Hopefully someone can shed a light on this.

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-jetty-response-body-tp5773652p5773712.html
Sent from the Camel - Users mailing list archive at Nabble.com.