simple-oauth1
simple-oauth1 copied to clipboard
Parameters added to URL for POST (Fitbit problem)
Hi, This code saved me endless hours while integrating the Fitbit API in RunGap (http://rungap.com). Thanks :) I discovered and fixed minor problem that prevented posting to Ftbit. The problem is that the parameters are also appended to the URL when posting. I simply replaced line 408 in OAuth1Controller.m:
if (queryString) request_url = [request_url stringByAppendingFormat:@"?%@", queryString];
with:
if (queryString && (![@"POST" isEqualToString:HTTPmethod])) request_url = [request_url stringByAppendingFormat:@"?%@", queryString];
Best Regards from Denmark Kristian
Hi Kristian,
Thanks (og tak)!
Have you tried your changes with other APIs than the Fitbit API, to see if if works with those too?
If so, it would be great if you could submit a pull request with your changes.
Cheers
Hi Christian,
No, I have not tried with other services.
It does not make sense to duplicate the parameters from the POST body in the URL, which would just increase network traffic. So, I would be surprised if this would break the other services.
Thanks again and Best Regards from (currently) sunny Denmark
Kristian
On Fri, Oct 24, 2014 at 9:44 AM, Christian Hansen [email protected] wrote:
Hi Kristian, Thanks (og tak)! Have you tried your changes with other APIs than the Fitbit API, to see if if works with those too? If so, it would be great if you could submit a pull request with your changes.
Cheers
Reply to this email directly or view it on GitHub: https://github.com/Christian-Hansen/simple-oauth1/issues/11#issuecomment-60360063
Awesome! I spent several hours looking in the wrong place because Fitbit's API was just saying "invalid oauth_signature". This helped immensely. This is my first time dealing with oauth.