commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kedar Panse <ke...@bancbridge.com>
Subject Re: {HttpClient} Invalid URI pickle
Date Mon, 26 Jul 2004 18:41:09 GMT
Ohh that worked perfect!  Thanks

Kedar

Michael Becke wrote:

> Hello Kedar,
>
> The method constructors expect the URI to be URL encoded.  So for 
> example if you are using:
>
>   GetMethod get = new GetMethod(someURI);
>
> Then 'someURI' is expected to be URL encoded.  You can encode URIs 
> using the HttpClient URI class:
>
>   URI uri = new URI(someURI);
>   GetMethod get = new GetMethod(uri.getEscapedURI());
>
> Mike
>
> On Jul 22, 2004, at 11:28 PM, Kedar Panse wrote:
>
>> I am in pickle here.  I am trying to submit a post request to a URI 
>> which contains invalid uri characters IE/Netscape/firefox handles 
>> this fine.
>> I get exception:
>>
>> Invalid uri '/loginserves/MYapp-{16FDC94F-736C-1DD1-8347-080020D8FE35}'
>>
>>
>> Now even if I replace { } with %7B and %7D and try to submit it, 
>> HTTPclient
>>
>> sends request but encodes it again , meaning % is converted to %25
>>
>> so  /loginserves/MYapp-%7B16FDC94F-736C-1DD1-8347-080020D8FE35%7D
>> becomes %257B16FDC94F-736C-1DD1-8347-080020D8FE35%257D
>>
>> before it posts the data
>>
>> and messes up the server.
>>
>> I wonder if methodbase should have constructor with URI as argument 
>> where I can specify if its escaped already??
>>
>> In the mean while any suggestions?
>>
>> Thanks,
>>
>> Kedar
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>



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


Mime
View raw message