simple-oauth1 icon indicating copy to clipboard operation
simple-oauth1 copied to clipboard

Parameters added to URL for POST (Fitbit problem)

Open ottosen opened this issue 10 years ago • 3 comments

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

ottosen avatar Oct 24 '14 07:10 ottosen

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

chrhansen avatar Oct 24 '14 08:10 chrhansen

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

ottosen avatar Oct 29 '14 10:10 ottosen

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.

wesselj1 avatar Mar 19 '15 17:03 wesselj1