check_for_status: check_for_status

Description Usage Arguments Value Examples

Description

check_for_status

Usage

1
2
check_for_status(x, type = "error", message_function = message_standard,
  ...)

Arguments

type

character, one of "error", "warning", "message"

message_function

function, builds message, takes x as first arguement, ... as additional arguements. Default is a standard message function.

...

additional arguements for message_function

Value

If request was successful, an invisible TRUE. Otherwise, raised a classed http error or warning, as generated by http_condition

Examples

1
2
x <- httr::GET("http://httpbin.org/status/404")
  check_for_status(x, type = "error", message_function = message_verbose)

ijlyttle/httrplus documentation built on May 18, 2019, 3:41 a.m.