Skip to content

There are three steps needed to perform a HTTP request with httr2:

  1. Create a request object with request(url) (this function).

  2. Define its behaviour with req_ functions, e.g.:

  3. Perform the request and fetch the response with req_perform().

Usage

request(base_url)

Arguments

base_url

Base URL for request.

Value

An HTTP request: an S3 list with class httr2_request.

Examples

request("http://r-project.org")
#> <httr2_request>
#> GET http://r-project.org
#> Body: empty