hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Johnson <sjohn...@mercury.com>
Subject URL escaping
Date Wed, 07 Jul 2004 15:53:03 GMT
Hi All,
Here is a URL that throws an exception if passed to GetMethod as is:
throws something like invalid argument or uri. 
It appears to be the unescaped characters in /tr/cl/1,,TRAVELOCITY|987,00.html
The problem is if the whole string is escaped then these escaped characters are double encoded:
to %325fService%253d
which causes a server error 500. 
Is there a simple way to send any request without complaining about the URI?
If this URL is pasted into IE it works.
Currently doing this:
        URI parsedURI = null;
        // if at first you don't succeed.
        try {
            try { // again.
                parsedURI = new URI(url.toCharArray()); // This throws on the URL above
            } catch (URIException e) {
                parsedURI = new URI(url, I18N.getDefaultEncoding());  // This double encodes
the URL above.
} catch (URIException e) {
Thanks for your time and help,
Steve Johnson
Software Engineer
Mercury Interactive
720 564 - 6532
USA, Canada and the Americas 
720 564-6620
Hours: M-F 08:00-17:00 MST (Mountain Standard Time) 
 <http://www.mercuryinteractive.com> http://www.mercuryinteractive.com
Looking for Answers to your SiteScope or SiteSeer questions?        <http://support.mercuryinteractive.com>

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