Jetty: Work around for square brackets in URLs?

In my binding for the Siemens smart thermostat, I originally used the HTTPS component from “javax.net.ssl.HttpsURLConnection” and this worked just fine.

However in its first code review @Kai asked me to use “org.eclipse.jetty.client.HttpClient” instead, so I spent half a day re-coding this. But to discover that the Jetty component causes Illegal Character Exceptions when I try to use square bracket characters [] in the parameters of some of the Siemens cloud server URIs, and the problem is that the Siemens cloud server (perhaps non RFC compliant) requires that such characters must be delivered verbatim and NOT escaped.

So my question(s) are 1) is there a solution where I can use Jetty as requested by @Kai but force the [] characters to be sent verbatim?, or 2) if not, then am I allowed to revert to the javax component, or 3) if not again, which component do you prefer me to use?

Hm, sorry to hear that my comment causes you that much trouble :frowning:.

Indeed, Jetty is correct with its Exception as brackets are not allowed in URIs (at least for parameters).

I do not see a way for (1), so I guess we have to exceptionally accept (2). Would be nice if you could add a comment in the code about this decision and its reasoning. Thanks!