hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyama Ashok-E51121" <ky...@motorola.com>
Subject RE: Problem with encoded url param to HttpClient.
Date Mon, 31 Jul 2006 03:55:22 GMT
Is there any java class/commons libraries which can encode the url that
HttpClient accepts.

Thank You
Kyama 

-----Original Message-----
From: Roland Weber [mailto:http-async@dubioso.net] 
Sent: Sunday, July 30, 2006 9:56 AM
To: HttpClient User Discussion
Subject: Re: Problem with encoded url param to HttpClient.

Kyama Ashok-E51121 wrote:
>  Hi,
> 
> Iam passing result of
> URLEncoder.encode(http://200.12.23.21:8898/PCT/content\update\pack\mul
> ti
> .xml) to HttpClient GetMethod(url).
>  And I got the exception:
> java.lang.IllegalArgumentException: Invalid uri
> 'http://200.12.23.21:8898/PCT/content\update\pack\multi.xml': escaped 
> absolute path not valid

The URL is invalid because it contains backslashes.
URLEncoder does *not* generate valid URLs, it only generates
*parameters* in a URL-safe encoding.
That's for the "...?param=value" part of a URL.

cheers,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message