cached-http-verbs {httpcache} | R Documentation |
These functions set, read from, and bust the HTTP query cache. They wrap the similarly named functions in the httr package and can be used as drop-in replacements for them.
GET(url, ...)
PUT(url, ..., drop = dropCache(url))
POST(url, ..., drop = dropOnly(url))
PATCH(url, ..., drop = dropCache(url))
DELETE(url, ..., drop = dropCache(url))
url |
character URL of the request |
... |
additional arguments passed to the httr functions |
drop |
For |
GET
checks the cache before making an HTTP request, and if there is a cache
miss, it sets the response from the request into the cache for future
requests. The other verbs, assuming a more or less RESTful API, would be
assumed to modify server state, and thus they should trigger cache
invalidation. They have default cache-invalidation strategies, but you can
override them as desired.
The corresponding httr response object, potentially read from cache