I've been trying to work through the OAuth steps presented at
http://dev.twitter.com/pages/auth#signing-requests . The psuedo-code for
base-string generation is given as

httpMethod + "&" +
 url_encode(  base_uri ) + "&" +
 sorted_query_params.each  { | k, v |
     url_encode ( k ) + "%3D" +
     url_encode ( v )

 But, this doesn't seem to work with the params on the example. The example
has baseString = POST&https%3A%2F%2Fapi.twitter.com

With the above algorithm, wouldn't the baseString end up as
The %3A seems to be getting encoded somehow to %253A in the example. I have
been able to get my result to match the example result by modifying the
algorithm to be

httpMethod + "&" +
 url_encode(  base_uri ) + "&" +
 url_encode(sorted_query_params.each  { | k, v |
     url_encode ( k ) + "=" +
     url_encode ( v )

  Reading the comments at
it seems we should be doing a double url-encode? Is that right or am I
missing something (and this workaround is just working in this example)?


Reply via email to