For the lazy readers, here's how to use it:
String encodedString = URLEncoder.encode("the key", "UTF-8") + "=" + URLEncoder.encode("the value with any type of character such as @, ñ, or even ç!", "UTF-8");
When POSTing to a URL, it is necessary to encode the parameters you are sending. Not doing so correctly will likely introduce bugs in the communication as the server will not know how to deal with (decode) the recieved data.
Lookin at the javadocs for URLEncoder, we find that normal alpha-numeric characters remain the same after encoding them to UTF-8, but other characters, such as the equal sign, change.
The server expects something like key1=value1&key2=value2. The = and & signs must be sent as is, without encoding. The URLEncoder.encode method is not "smart" enough to know that = and & are to be used as part of the URL. Of course, it isn't fair to assume that...
