Java URL Encoding String Parameters

Java URL Encoding String Parameters

Java provide URLEncoder to encode parameter which could be send thorugh URL to the server. Important things to note that while you are doing encoding you should encode individual parameter separately then name or value not the entire URL and also not the stirng parameter separator character & nor paramter name-value charater =. Please have below sample Java program for URL encoding:

  • URLEncoding.java:

  • Output:

Java URL Encoding String Parameters

  • For more information on URLEncoding please visit Oracle documentation here

Leave a Reply

Your email address will not be published. Required fields are marked *