Returns the JSON/HAR content representing all the HTTP traffic passed through the proxy (provided you have already created the HAR with createHAR)

getHAR(proxy, ...)

Arguments

proxy
An object of class "proxy". A proxy object see proxy.
...
Additonal function arguments

Value

Returns the HAR as parsed JSON content

See also

Other har functions: createHAR, newPage

Examples

## Not run: ------------------------------------ # # A BMP server is assummed running on port 9090 # prxy <- proxy(bmpPort = 9090L, port = 39500L) # library(httr) # prxy %>% createHAR(ref = "httr_traffic_1") # # use httr_proxy to configure proxy for httr # rproj <- GET("https://www.r-project.org/", httr_proxy(prxy)) # httr_har <- prxy %>% getHAR() # httr_har[["log"]][["entries"]][[1]]["request"] # httr_har[["log"]][["entries"]][[1]]["response"] # # # set new page # prxy %>% newPage(ref = "httr_traffic_2") # rcran <- GET("https://cran.r-project.org/", httr_proxy(prxy)) # httr_har <- prxy %>% getHAR() # vapply(httr_har[["log"]][["pages"]], '[[', character(1), "id") # # [1] "httr_traffic_1" "httr_traffic_2" # prxy %>% closeProxy ## ---------------------------------------------