-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support {httr2} #237
Comments
That's the idea! To have support for it we need support for httr2 in webmockr as well as here. Any extra time to contribute to these changes? |
Unfortunately I don't. I am not familiar with the webmockr/vcr codebase, so I'd need a lot of extra time too, I'm afraid. |
Okay, no problem. Will try to get to it soon unless someone else has time |
@sckott just wondering if you had any time to look into this? No worries if not, of course! (I would not know how 😬) |
not much yet unfortunately. i started a while back on webmockr ropensci/webmockr@master...httr2 but nothing useable yet. |
Almost there, left to do:
vcr::use_cassette("stuff", {
res_vcr1 <- request("https://google.com") %>% req_perform()
})
vcr::use_cassette("stuff", {
res_vcr2 <- request("https://google.com") %>% req_perform()
})
res_vcr1
#> <httr2_response>
#> GET https://google.com/
#> Status: 200 OK
#> Body: In memory (7070 bytes)
res_vcr2
#> <httr2_response>
#> GET https://google.com/
#> Status: 200 OK
#> Body: In memory (1 bytes)
Setting global deferred event(s).
i These will be run:
* Automatically, when the R session ends.
* On demand, if you call `withr::deferred_run()`.
i Use `withr::deferred_clear()` to clear them without executing. |
this is great! is there a public package where you're using httr2+vcr? |
No, not yet. I shjould make a silly small pkg just to demonstrate though. @maelle do you have a sense about that warning above from |
do you get that warning when running the tests or else? I actually blogged about |
When you run |
wrt that |
|
Would looking at https://github.com/nealrichardson/httptest2/tree/main/R help? I'm not familiar with how it works under the hood. |
(There was an issue I thought was related to the httr2 integration here, but was a redirect issue that's not germaine to httr2, see #267) |
In testing this I don't see the |
The test package for testing the httr2/vcr integration is up on my account https://github.com/sckott/rrr |
wowsa - this thing about |
A few things i'm wokring on now that will hopefully be the last things:
Pretty sure above 2 are taken care of now with current state on |
* started httr2 integration work #237 * export RequestHandlerHttr2 * bmp version * import httr2 * remove --no-build-vignettes in R CMD INSTALL * add depends R >= 3.5 for data * add RequestHandlerHttr2 to pkgdown yaml * add req_error to httr2 handler so that httr2 doesnt turn a http errror status code into an R error * compatabiilty for httr2 here and there * udpate docs to talk about all 3 http pkgs * update readm.md * woops, errant debug line * tickle R check * update man file for Cassette class * httr2: get last response with last_response after req_perform * httr2: fix status code retrieval * httr2 response handling in Cassette class * uncomment commented out tests that now work * fix a bunch of httr2 tests * update roxygen2 version * REVDEPCHECK * REVDEPCHECK - use gh pat
Now that {httr2} is on CRAN and supports mocking, could {vcr} support it as well?
The text was updated successfully, but these errors were encountered: