Reputation: 1141
String urlParameters = "login=test&password=te&ff";
I have a String urlParams, & - is part of the password, how to make it escaped, thus not be recognized as a separator?
Upvotes: 0
Views: 158
Reputation: 21961
Encode your password using URLEcoder#encode with utf-8
String urlParameters = "login=test&password="+
URLEncoder.encode("te&ff", "UTF-8");
Upvotes: 1
Reputation: 7403
Use a URL Encoder on each of the components: http://docs.oracle.com/javase/7/docs/api/java/net/URLEncoder.html
Upvotes: 1