+3  A: 

java.net.URLEncoder should work for you - though you would have to extend it to accept the hashmap - but that is not very difficult.

Shane C. Mason
Agreed. URLEncoder is the correct class to use.
gpampara
question updated
Quintin Par
Yes - you can avoid that by using a hashmap and a loop :)
Shane C. Mason