x: Object to check. Default methods are provided for strings (which perform an HEAD() request), responses, and integer status codes.
...: Other arguments passed on to methods.
Returns
TRUE if the request fails (status code 400 or above), otherwise FALSE.
Examples
## Not run:# You can pass a url:http_error("http://www.google.com")http_error("http://httpbin.org/status/404")# Or a requestr <- GET("http://httpbin.org/status/201")http_error(r)## End(Not run)# Or an (integer) status codehttp_error(200L)http_error(404L)
See Also
Other response methods: content(), http_status(), response(), stop_for_status()