How to encode a URL in Java

To encode a URL in Java you can use the following snippet.
Also take a look at How to decode a URL in Java.

Sample Java

URLEncoder.encode("http://codesnippets.fesslersoft.de/");  

Please Share us:
Please rate this snippet

One thought on “How to encode a URL in Java

Leave a Reply