Learn R Programming

pxweb (version 0.17.0)

http_was_redirected: http_was_redirected

Description

http_was_redirected

Usage

http_was_redirected(r)

Value

list with slots was_redirected, redirected_from and redirected_to

Arguments

r

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

References

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

Examples

Run this code
if (FALSE) {
r <- httr::GET("http://httpbin.org/redirect/2")
pxweb:::http_was_redirected(r)
}

Run the code above in your browser using DataLab