Skip to content
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

Use auth token with httr read rds file #307

Open
HugoGit39 opened this issue Dec 12, 2023 · 0 comments
Open

Use auth token with httr read rds file #307

HugoGit39 opened this issue Dec 12, 2023 · 0 comments

Comments

@HugoGit39
Copy link

Hi

So let me begin that its not a real bug, but more a question for help:

From the rangespread() function I see that a google sheet can be read using the auth token via:

`# service account token
drive_auth(path = "....json")

#google4sheets authentication
gs4_auth(token = drive_token())

token <- gs4_token()
response <- httr::GET(url, config = token)
df <- read_csv(content(response, type = "raw"))`

So for an RDS file I thought it should be the same. However the response I get is a

Content-Type: text/html; charset=utf-8

Does anyone know how i can extract the df correctly?

Cause without an auth token the response of a RDS file can be read via:

response <- httr::GET(url)
cn <- rawConnection(httr::content(response, type = "raw"))
df <- readRDS(gzcon(cn))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant