View source: R/response-status.r
http_error | R Documentation |
Check for an http error.
http_error(x, ...)
x |
Object to check. Default methods are provided for strings
(which perform an |
... |
Other arguments passed on to methods. |
TRUE
if the request fails (status code 400 or above),
otherwise FALSE
.
Other response methods:
content()
,
http_status()
,
response()
,
stop_for_status()
## Not run:
# You can pass a url:
http_error("http://www.google.com")
http_error("http://httpbin.org/status/404")
# Or a request
r <- GET("http://httpbin.org/status/201")
http_error(r)
## End(Not run)
# Or an (integer) status code
http_error(200L)
http_error(404L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.