I am trying a simple url encoding that needs to be done for the URL below:
https://example.org/v1/x/y/Quick Brown Fox/jumps/over/
I use the below code:
String url = https://example.org/v1/x/y/Quick Brown Fox/jumps/over/;
url = UrlEncoder.encode(url,"UTF-8");
Ideally, this should provide output like -
https://example.org/v1/x/y/Quick%20Brown%20Fox/jumps/over/
which is the correct encoding. Instead it ends up replacing space with +
Using JDK 11 - I need %20 because I am using Apache HTTP client to send HTTP request and URI does not take +
in the URL where spaces are present.