Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

URL Encoding/Decoding

807588Feb 11 2009 — edited Feb 16 2009
Hi ,

I am trying to send an HttpRequest to a web server using the org.apache.commons.httpclient
Now the problem i am facing is if the URL has some special characters like a space,`,\, ... the GetMethod() of httpClient throws an IllegalArgumentException.
I tried to use URLEncode and other java classes but that does not work since it encodes the "/" in the URL as well, and also sometimes the input URL may be already encoded so i don't want to encode it again.
Please suggest a proper way to handle the situation.

Thanks,
Sunil.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 16 2009
Added on Feb 11 2009
4 comments
608 views