resp_url() returns the complete url.
resp_url_path() returns the path component.
resp_url_query() returns a single query component.
resp_url_queries() returns the query component as a named list.
resp_url(resp)
resp_url_path(resp)
resp_url_query(resp, name, default = NULL)
resp_url_queries(resp)A httr2 response object, created by req_perform().
Query parameter name.
Default value to use if query parameter doesn't exist.
resp <- request(example_url()) |>
req_url_path("/get") |>
req_url_query(hello = "world") |>
req_perform()
resp |> resp_url()
#> [1] "http://127.0.0.1:44765/get?hello=world"
resp |> resp_url_path()
#> [1] "/get"
resp |> resp_url_queries()
#> $hello
#> [1] "world"
#>
resp |> resp_url_query("hello")
#> [1] "world"