
stop_for_status(x, task = NULL)warn_for_status(x, task = NULL)
message_for_status(x, task = NULL)
status_code
method)NULL
or a
character vector. If non-NULL
, the error message will finish with
"Failed to task
".http_condition
http_status
and
http://en.wikipedia.org/wiki/Http_status_codes
for more information
on http status codes.Other response methods: content
,
http_error
, http_status
,
response
x <- GET("http://httpbin.org/status/200")
stop_for_status(x) # nothing happens
warn_for_status(x)
message_for_status(x)
x <- GET("http://httpbin.org/status/300")
stop_for_status(x)
warn_for_status(x)
message_for_status(x)
x <- GET("http://httpbin.org/status/404")
stop_for_status(x)
warn_for_status(x)
message_for_status(x)
# You can provide more information with the task argumgnet
warn_for_status(x, "download spreadsheet")
message_for_status(x, "download spreadsheet")
Run the code above in your browser using DataLab