How do I properly encode "[" and "]" in requests using Apache HttpClient?
I have a GET method that looks like this:
GetMethod method = new GetMethod("http://host/path/?key=[\"item\",\"item\"]");
This path works just fine when entered directly into the browser, but the above line throws an IllegalArgumentException on startup: Invalid URI.
I have considered using the URIUtils class but with no success. Is there a way to auto-encode this (or add a query string to the url without calling the HttpClient for barf?).
+2
source to share