UriBuilder incorrectly encoding Query Parameters value ?
- by Fred
Lets consider the following code sample where a path and single parameter are encoded...
Parameter name: "param"
Parameter value: "foo/bar?aaa=bbb&ccc=ddd" (happens to be a url with query parameters)
String test = UriBuilder.fromPath("https://dummy.com").
queryParam("param", "foo/bar?aaa=bbb&ccc=ddd").
build().toURL().toString();
The encoded URL string returned is:
"https://dummy.com?param=foo/bar?aaa%3Dbbb&ccc%3Dddd"
Is this correct ?
Should not the character "&" (and may be even "?") be encoded in the parameter value string ?
Would not the URL produced be interpreted as follow:
One first parameter, name="param", value = "ar?aaa%3Dbbb" followed by a second parameter, name="ccc%3Dddd", without value.