You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Kedar Panse <ke...@bancbridge.com> on 2004/07/26 20:41:09 UTC

Re: {HttpClient} Invalid URI pickle

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