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

get/set cookie? #44

Closed
happyshows opened this issue Jul 19, 2017 · 4 comments
Closed

get/set cookie? #44

happyshows opened this issue Jul 19, 2017 · 4 comments
Milestone

Comments

@happyshows
Copy link

Hi,

I have a use case where I need to set up cookie value when running GET/POST method (for a tmp authentication purpose). Is there a way to do so in this package?

@sckott
Copy link
Collaborator

sckott commented Jul 19, 2017

thanks for the issue @happyshows

at the moment there's nothing built in to help with cookies.

you can set them manually like

x <- HttpClient$new(
  url = "https://httpbin.org",
  opts = list(cookie = "c=1;f=5")
)

# set cookies
res <- x$get("cookies")
jsonlite::fromJSON(res$parse("UTF-8"))

but they aren't yet persisted across requests - working on that

working on some docs for this

@sckott
Copy link
Collaborator

sckott commented Aug 31, 2017

DOAJ sets cookies - good eg to work with

@sckott sckott added this to the v0.4 milestone Sep 27, 2017
sckott added a commit that referenced this issue Sep 27, 2017
#44 cookies man file for showing how to work with cookies, hopefully works
as part of reusing handles, moved make_url inside of httpclient class
bumped dev version
@sckott
Copy link
Collaborator

sckott commented Sep 27, 2017

@happyshows can you reinstall devtools::install_github("ropensci/crul") and try again? let me know if cookies work for you for your use case

@sckott
Copy link
Collaborator

sckott commented Oct 1, 2017

i think we're good here

@sckott sckott closed this as completed Oct 1, 2017
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

2 participants