Description
When passing query parameters to a REST producer the encoding behavior is inconsistent. Consider the following:
.to("rest:get:bw-web-api/v1/objects/employees?host=agresso&companyId=RD&select=personId,personName&disconnect=true")
The resulting request payload, as observed with Wireshark, is:
GET /bw-web-api/v1/objects/employees?companyId=RD&disconnect=true&select=personId%252CpersonName HTTP/1.1\r\n
Note that the comma has been double-encoded resulting in transmission of %252C instead of the expected %2C.
If instead the problem string is passed as a parameter via a header, the comma is correctly encoded:
.setHeader("select", simple("personId,personName")) .to("rest:get:bw-web-api/v1/objects/employees?host=agresso&companyId=RD&select={select}&disconnect=true")