req_cached | R Documentation |
Convenience wrapper around a bunch of httr2 functions.
req_cached(url, max_tries = 3L)
url |
HTTP protocol address. The scheme is optional, so both |
max_tries |
Maximum number of request attempts in case of an HTTP error. An integerish scalar. Retries are performed using exponential backoff and jitter, see |
If the HTTP request succeeds, and the status code is ok (e.g. 200), an HTTP response.
If the HTTP request succeeds, but the status code is an error
(e.g a 404), an error with class c("httr2_http_404", "httr2_http")
.
By default, all 400 and 500 status codes will be treated as an error,
but you can customise this with req_error()
.
If the HTTP request fails (e.g. the connection is dropped or the
server doesn't exist), an error with class "httr2_failure"
.
Other HTTP functions:
is_http_success()
,
is_url()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.