Learn R Programming

httr2 (version 1.0.3)

req_timeout: Set time limit for a request

Description

An error will be thrown if the request does not complete in the time limit.

Usage

req_timeout(req, seconds)

Value

A modified HTTP request.

Arguments

req

A request.

seconds

Maximum number of seconds to wait

Examples

Run this code
# Give up after at most 10 seconds
request("http://example.com") |> req_timeout(10)

Run the code above in your browser using DataLab