I have to encode querystring value in a http request in Java. For example:
http://mysite.com/service?name=James Smith&address=my street
must become:
http://mysite.com/service?name=James%20Smith&address=my%20street
I have to do this in a method where I have querystring value in input, so I have to encode only the value (James Smith, my street, ecc.). I was thinking about using this method org.apache.commons.httpclient.util.URIUtil.encodeWithinQuery: is this right? I have seen many confusing discussion about encoding http request.