New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_config and with_config not work with token config #111

Closed
artemklevtsov opened this Issue Jun 17, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@artemklevtsov
Contributor

artemklevtsov commented Jun 17, 2014

Hi.

I observe strange behaviour with the config options.

is(token) # my token
[1] "Token2.0"     "Token"        "envRefClass"  ".environment" "refClass"     "environment"  "refObject"
> http_status(GET(url, config(token = token)))$message
[1] "success: (200) OK"
> http_status(with_config(config(token = token), GET(url)))$message
[1] "client error: (401) Unauthorized"
Warnings
1: In mapCurlOptNames(names(.els), asNames = TRUE) :
  Unrecognized CURL options: token
2: In mapCurlOptNames(names(.els), asNames = TRUE) :
  Unrecognized CURL options: token

Same here with set_config.

``
regards,
Artem Klevtsov

@artemklevtsov artemklevtsov changed the title from [token] set_config and with_config not work to set_config and with_config not work with token config Jun 17, 2014

@hadley

This comment has been minimized.

Member

hadley commented Jul 5, 2014

Could you please provide a reproducible example?

@artemklevtsov

This comment has been minimized.

Contributor

artemklevtsov commented Jul 6, 2014

For example get the list of google analytics accounts:

token <- oauth2.0_token(endpoint = oauth_endpoints("google"),
                        app = oauth_app(appname = "test-app", key = "my_key", secret = "my_secret"),
                        cache = FALSE, scope = "https://www.googleapis.com/auth/analytics.readonly")
url <- "https://www.googleapis.com/analytics/v3/management/accounts"
http_status(GET(url, config(token = token)))$message
http_status(with_config(config(token = token), GET(url)))$message

You can obtain key and secret here.

@hadley hadley closed this in 073e3a0 Jul 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment