-
Notifications
You must be signed in to change notification settings - Fork 6
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
curl support #40
Comments
thanks for the nudge @nbenn Integrating with a http client library (e.g., what functions do you use in |
Thanks for the quick response. The package I'm hoping to use |
thanks for the clarification @nbenn - will update on any progress |
Let me know if there is anything I can do to help. I'm happy to. |
@nbenn okay, try after installing like see examples here https://github.com/ropensci/webmockr/blob/adapter-curl/R/adapter-curl.R#L37-L66 it's a bit of a hack - it's not easy to inspect the curl handle so we use thx to @jeroen for help. he and I will talk more about possibly avoiding doing the |
@sckott thanks a lot for moving so quickly with this and I am sorry that it took a bit of time for me to have a look at it. Naturally, down the line, I'm interested in getting webmockr and vcr to work with curl. But first, in order to get the automated recording of requests working, we'd need the curl::mock(FALSE) # tempoarily disable
resp <- eval(req$called)
curl_resp <- build_curl_response(req, resp)
curl::mock(TRUE) # re-enable Or am I missing something here? Are you interested in PRs? |
yeah, PRs welcome. makes total sense you'd need net connect allowed working. does nbenn/curl@50571d8 make net connect allowed work? does the use of |
fix for allow net connect for curl adapter in 850b31f |
@nbenn can you reinstall |
@nbenn did you get a chance to try this yet? |
@sckott I haven't tried any |
ok, thanks |
changes in 3b05bc1 |
@nbenn if you have a chance, just updated the integration with |
@sckott sorry for the crazy long delay on my side. I got round to testing For me,
and
finally, the error that is thrown is
Of course, only selectively pasting What reason do you have for doing called <- gsub("\\(|\\)", "", deparse(sys.call())) You already have url and handle, which suffice to re-build the original call later on, no? Are you only after the function name? In that case, why not something like |
Is |
I thought I had started work on |
thanks for testing this @nbenn I'm not surprised you ran into trouble as I probably only tested it in a very narrow set of cases. First, note that I'm not positive @jeroen will integrate for
i don't know for sure why, i think your pr is better |
your two PR's are merged now. |
@nbenn sorry for long delay on this, jeroen and I talked again the other day and we decided curl wont integrate with webmockr mostly b/c curl is just too important to possibly introduce edge case bugs into |
I'm interested in using webmockr for a test suite of mine, but I'm currently using jeroen/curl for making http requests.
Are there plans on supporting curl or is this not happening anytime soon?
The text was updated successfully, but these errors were encountered: