cached-http-verbs: Cache-aware versions of httr verbs

Description Usage Arguments Details Value See Also

Description

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.

Usage

1
2
3
4
5
6
7
8
9

Arguments

url

character URL of the request

...

additional arguments passed to the httr functions

drop

For PUT, PATCH, POST, and DELETE, code to be executed after the request. This is intended to be for supplying cache-invalidation logic. By default, POST drops cache only for the specified url (i.e. dropOnly()), while the other verbs drop cache for the request URL and for any URLs nested below it (i.e. dropCache()).

Details

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.

Value

The corresponding httr response object, potentially read from cache

See Also

dropCache() cachedPOST()


httpcache documentation built on Jan. 13, 2021, 7:46 p.m.