resp_status: Extract HTTP status from response

Description Usage Arguments Value Examples

View source: R/resp-status.R

Description

These functions are mostly for internal use because in most cases you will only ever see a 200 response:

Usage

1
2
3
4
5
6
7

Arguments

resp

An HTTP response object, as created by req_perform().

info

A character vector of additional information to include in the error message. Passed to rlang::abort().

Value

Examples

1
2
3
4
5
# An HTTP status code you're unlikely to see in the wild:
resp <- response(418)
resp %>% resp_is_error()
resp %>% resp_status()
resp %>% resp_status_desc()

httr2 documentation built on Sept. 28, 2021, 5:10 p.m.