http_was_redirected: http_was_redirected

View source: R/pxweb_add_config.R

http_was_redirectedR Documentation

http_was_redirected

Description

http_was_redirected

Usage

http_was_redirected(r)

Arguments

r

an httr response object, e.g. from a call to httr::GET()

Value

list with slots was_redirected, redirected_from and redirected_to

References

Function in large parts taken from https://petermeissner.de/blog/2018/11/07/using-httr-to-detect-redirects/.

Examples

## Not run: 
r <- httr::GET("http://httpbin.org/redirect/2")
pxweb:::http_was_redirected(r)

## End(Not run)

pxweb documentation built on May 29, 2024, 2:28 a.m.