I know that definition of URL says:
Most people realize that a space is not allowed in a URL. However, it is also important to realize, as documented in RFC 1738, the URL string can only contain alphanumeric characters and the !$-_+*'(), characters. Any other characters that are needed in the URL must be encoded.
But just to be sure, that will means that only 1 "?" character it´s allowed in the query, so my code it´s safe right?
protected String addClientId(String uri) {
return uri.contains("?") ? uri.concat("&clientId=" + clientId) : uri.concat("?clientId=" + clientId);
}
I just want to be sure that even encoding the ? cannot appear in the url.
Regards.