Re: question regarding http post
Sunday, April 29, 2001 08:53 PM
Yes all values that are passed either using GET and POST have to be URLEncoded, to assure that only the right chars are used.
What is happening to you is that you are building the string and then encoding all that string. What, instead, you should do, it's url encoding each value (and even the key if you have special character in it) before building the final string. Something like:
String s += "&" + URLEncoder.encode(key) + "=" + URLEncoder.encode(value);
(ps: if you have to build the string, StringBuffer it's a better choice).