pxweb (version 0.9.1)

http_was_redirected: http_was_redirected

Description

http_was_redirected

Usage

http_was_redirected(r)

Arguments

response

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

Run this code
# NOT RUN {
  r <- httr::GET("http://httpbin.org/redirect/2")
  http_was_redirected(r)
# }

Run the code above in your browser using DataLab