Camel jetty response body

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel jetty response body

souciance
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
Reply | Threaded
Open this post in threaded view
|

Re: Camel jetty response body

souciance
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.