You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Jeroen van Vianen <je...@vanvianen.nl> on 2009/03/30 23:16:31 UTC

httpclient 3.1 using RFC 3986 encoding rules?

Hi,

I am trying to implement an interface to an OAuth server. OAuth requires 
RFC 3986 [1] rather than RFC 1738 [2] encoding rules for URIs, more 
specifically a space should be encoded as '%20' and not as '+'. This 
breaks oauth_signature calculations.

Is there a way to use / force HttpClient into RFC's encoding rules on 
GETs and POSTs?

Thanks and best regards,


Jeroen


[1] http://www.ietf.org/rfc/rfc3986.txt, section 2.1
[2] http://www.ietf.org/rfc/rfc1738.txt

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


Re: httpclient 3.1 using RFC 3986 encoding rules?

Posted by Jeroen van Vianen <je...@vanvianen.nl>.
Oleg Kalnichevski wrote:
> Jeroen van Vianen wrote:
>> Oleg Kalnichevski wrote:
>>> Jeroen van Vianen wrote:
>>>> I am trying to implement an interface to an OAuth server. OAuth 
>>>> requires RFC 3986 [1] rather than RFC 1738 [2] encoding rules for 
>>>> URIs, more specifically a space should be encoded as '%20' and not 
>>>> as '+'. This breaks oauth_signature calculations.
>>>>
>>>> Is there a way to use / force HttpClient into RFC's encoding rules 
>>>> on GETs and POSTs?
>>>>
>>>
>>> No, there is not.
>>>
>>> Consider migrating to HttpClient 4.0
>>
>> But does HC 4.0 allow me to specify whether I want to use RFC 1738 or 
>> 3986 encoding rules? I could not find it. If I look in the code of HC 
>> 4.0 it uses URLEncoder.encode, which doesn't help either.
>>
> 
> You can implement a custom HttpRequest.

OK, will have a look. Thanks.


Jeroen

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


Re: httpclient 3.1 using RFC 3986 encoding rules?

Posted by Oleg Kalnichevski <ol...@apache.org>.
Jeroen van Vianen wrote:
> Oleg Kalnichevski wrote:
>> Jeroen van Vianen wrote:
>>> I am trying to implement an interface to an OAuth server. OAuth 
>>> requires RFC 3986 [1] rather than RFC 1738 [2] encoding rules for 
>>> URIs, more specifically a space should be encoded as '%20' and not as 
>>> '+'. This breaks oauth_signature calculations.
>>>
>>> Is there a way to use / force HttpClient into RFC's encoding rules on 
>>> GETs and POSTs?
>>>
>>
>> No, there is not.
>>
>> Consider migrating to HttpClient 4.0
> 
> But does HC 4.0 allow me to specify whether I want to use RFC 1738 or 
> 3986 encoding rules? I could not find it. If I look in the code of HC 
> 4.0 it uses URLEncoder.encode, which doesn't help either.
> 

You can implement a custom HttpRequest.

Oleg

> Thanks and best regards,
> 
> 
> Jeroen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


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


Re: httpclient 3.1 using RFC 3986 encoding rules?

Posted by Jeroen van Vianen <je...@vanvianen.nl>.
Oleg Kalnichevski wrote:
> Jeroen van Vianen wrote:
>> I am trying to implement an interface to an OAuth server. OAuth 
>> requires RFC 3986 [1] rather than RFC 1738 [2] encoding rules for 
>> URIs, more specifically a space should be encoded as '%20' and not as 
>> '+'. This breaks oauth_signature calculations.
>>
>> Is there a way to use / force HttpClient into RFC's encoding rules on 
>> GETs and POSTs?
>>
> 
> No, there is not.
> 
> Consider migrating to HttpClient 4.0

But does HC 4.0 allow me to specify whether I want to use RFC 1738 or 
3986 encoding rules? I could not find it. If I look in the code of HC 
4.0 it uses URLEncoder.encode, which doesn't help either.

Thanks and best regards,


Jeroen

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


Re: httpclient 3.1 using RFC 3986 encoding rules?

Posted by Oleg Kalnichevski <ol...@apache.org>.
Jeroen van Vianen wrote:
> Hi,
> 
> I am trying to implement an interface to an OAuth server. OAuth requires 
> RFC 3986 [1] rather than RFC 1738 [2] encoding rules for URIs, more 
> specifically a space should be encoded as '%20' and not as '+'. This 
> breaks oauth_signature calculations.
> 
> Is there a way to use / force HttpClient into RFC's encoding rules on 
> GETs and POSTs?
> 

No, there is not.

Consider migrating to HttpClient 4.0

Oleg


> Thanks and best regards,
> 
> 
> Jeroen
> 



> 
> [1] http://www.ietf.org/rfc/rfc3986.txt, section 2.1
> [2] http://www.ietf.org/rfc/rfc1738.txt
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


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