request | R Documentation |
There are three steps needed to perform a HTTP request with httr2:
Create a request object with request(url)
(this function).
Define its behaviour with req_
functions, e.g.:
req_headers()
to set header values.
req_url_path()
and friends to modify the url.
req_body_json()
and friends to add a body.
req_auth_basic()
to perform basic HTTP authentication.
req_oauth_auth_code()
to use the OAuth auth code flow.
Perform the request and fetch the response with req_perform()
.
request(base_url)
base_url |
Base URL for request. |
An HTTP request: an S3 list with class httr2_request
.
request("http://r-project.org")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.