In Java, I need to use HTTP Post to send request to server, but if in the parameter of the URL contains some special character it throws below Exception
To encode text for safe passage through the internets:
import java.net.*;
...
try {
encodedValue= URLEncoder.encode(rawValue, "UTF-8");
} catch (UnsupportedEncodingException uee) { }
And to decode:
try {
decodedValue = URLDecoder.decode(rawValue, "UTF-8");
} catch (UnsupportedEncodingException uee) { }