sckott / webmiddens

cache http requests
https://sckott.github.io/webmiddens
Other
10 stars 1 forks source link

Any way to not require HTTP requests to be wrapped in a code block? #4

Closed sckott closed 4 years ago

sckott commented 4 years ago

Right now, we need to wrap HTTP call in midden$call()

Maybe we keep that as an option, to wrap http call in a block, but easier to use would be a configuration setting function call - then just do http requests as normal. eg.,

library(webmiddens)
# 1 hr expiry
midden$new(path = "foobar", expire = 3600)

# then http requests are using webmiddens
crul::HttpClient$new("https://httpbin.org")$get("get", query = list(foo = "bar"))

Not sure this is possible. We'd have to have a specific hook within crul for this

sckott commented 4 years ago

dont think this is necessary