An error will be thrown if the request does not complete in the time limit.
Arguments
- req
A httr2 request object.
- seconds
Maximum number of seconds to wait
Value
A modified HTTP request.
Examples
# Give up after at most 10 seconds
request("http://example.com") |> req_timeout(10)
#> <httr2_request>
#> GET http://example.com
#> Body: empty
#> Options:
#> • timeout_ms: 10000
#> • connecttimeout: 0