Is it possible to use apache's URIBuilder to set a parameter with percentage sign?

323 Views Asked by At

I want to build this complete URL:

locahost/some/path?param1=%06

using org.apache.http.client.utils.URIBuilder method setParameter(final String param, final String value). At its javadoc, there's line:

The parameter name and value are expected to be unescaped and may contain non ASCII characters

But when I use setParameter("param1","%06") I always get ...param1=%2506 instead of ...param1=%06. Looking here I noticed percent sign is 25 in hex.

Should I parse this manually or there's a way to keep using URIBuilder and keep the parameters as is?

0

There are 0 best solutions below