A complement to my last mail.
Ad 3)
After some more investigation I realized that the http-component consumer
doesn't set the CamelHttpRawQuery header (so maybe it isn't a miss in the
documentation after all).
However, the header is still handled by the code I referenced in my last mail
when using toD with the http-component. Could it be part of the toD
implementation (or some common http code used by different components) to
support the netty-http-component but it happens to work when I use the
http-component in the following way?
.setHeader(Exchange.HTTP_RAW_QUERY, header(Exchange.HTTP_QUERY))
toD(http("dummyHost:8181/dummySystem${header.CamelHttpPath}"))
Given the following query string when calling the REST-endpoint (I hope the
encoding of the last three characters will look right in this mail):
?lorem=ipsum&test=abc;åäö
toD will perform the following request (which seems correct to me):
GET
http://dummyHost:8181/dummySystem/test/altA/xyz?lorem=ipsum&test=%C3%A5%C3%A4%C3%B6
HTTP/1.1
For those interested, the above request line was collected from the
HttpProducer where the actual http call takes place:
https://github.com/apache/camel/blob/camel-3.4.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java#L200
My conclusion is that the way I use CamelHttpRawQuery seems to be a hack which
just happens to work when using toD with http-component. It also seems like
CamelHttpRawQuery isn't URL encoded before the actual http call takes place
(which I believe it should) and if it was, my code would not work as it
currently does. I suppose one of my other alternatives should be better to use.
What's your thoughts on this?