0
votes

I'm using camel rest java dsl with jetty component. Camel version is 2.18.0

The route provides a rest service that consumes json formatted request and produces json response. Doing so using POST is no problem.

But since these routes don't change no data, it would be preferrable to use GET as verb.

Is there any way to accept a json body in the upstream together with GET?

Does it depend on the underlying consumer?

Are there any examples to do so or am I fundamentally wrong in trying so?

Thanx in advance Henning

2

2 Answers

0
votes

Jetty component is deprecated as per the docs. You could build your endpoint using camel-restlet component , there you can use the restletMethod to specify the endpoint method.

0
votes

I gather, what I came across so far. With the help of Panayiotis answer, CAMEL-9611 notes that it seems to be explicitly deactivated, also is swagger missing the possibility to express body in GET requests.

It comes to the point that although the HTTP spec is rather vague about the usage of a body in a GET request, the usage is only seldomly supported by frameworks.

I hoped it would be possible to define complex query input using GET with a json body, since it would be much easier to define more complex queries. But while reading on, I get the impression, that this handling is discouraged because of the lack of support.