I want to build the following URI -
https://10.112.88.182:8443/Vehicle/services/socialService/login
...
Builder builder = new
That's how Uri.Builder
works. It encodes non-safe URL characters with special meaning to their %xx
hex values.
To prevent encoding URI parts that are already properly encoded, use the encoded
versions of builder functions:
builder.encodedAuthority(host);
builder.appendEncodedPath(service + "/" +method);
But since all your URL parts are already ready and don't need any further encoding, it's easier to just use a regular StringBuilder
to concatenate the parts.