hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fran├žois-Xavier Bonnet <francois-xavier.bon...@centraliens.net>
Subject Re: encode querystring value
Date Tue, 12 Feb 2013 09:25:44 GMT

This method is from HttpClient 3 which is now deprecated and not 
maintained anymore. In the latest versions you can use class 
I guess you are already using HttpClient on your project? If not, if you 
just need to encode values for querystring, you can use commons-codec 



On 12/02/2013 10:08, MF wrote:
> Hi all,
> 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, in my example). 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 in many other forum.
> Thanks for answering.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message