Skip to content

Use auth token with httr read rds file #307

Open
@HugoGit39

Description

@HugoGit39

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions