Archived Forum Post

Index of archived forum posts

Question:

comma in Oauth request

Oct 14 '13 at 11:52

Hi, When trying sending request with comma (,) to Twitter API, I have an error. Comma isn't encoded in the PostUrlEncoded Please fix it for Activex componment Regards.


Answer

Hi, I'm experiencing the same problem, even with QuickGetStr For PostUrlEncoded i resolved it replacing all commas in status by ";" or " "

To avoid errors returning by the API about commas in api Urls, i resolved it for example for users/lookup (passing user ids) by replacing each commas in the url by "&user_id=" and it works.

Hope this helps ;)

++ Seb


Answer

The default URL encoding used by Chilkat HTTP (i.e. in PostUrlEncoded) is according to RFC 3986, which is the URL encoding specified in the OAuth 1.0 RFC 5849. An older version of Chilkat would have used an older specification for URL encoding. RFC 3986 specifies that the comma character is part of the "sub-delims" that should not be encoded:

sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                 / "*" / "+" / "," / ";" / "="
I believe the OAuth 2.0 specification does not change the URL encoding rules. I don't know why there would be trouble with the comma character, but unfortunately Chilkat HTTP cannot be changed to not conform to RFC 3986. If there is a problem where Chilkat is not conforming to RFC 3986, then that would be a problem that needs to be addressed.