req_user_agent | R Documentation |
This overrides the default user-agent set by httr2 which includes the version numbers of httr2, the curl package, and libcurl.
req_user_agent(req, string = NULL)
req |
A httr2 request object. |
string |
String to be sent in the |
A modified HTTP request.
# Default user-agent:
request("http://example.com") |> req_dry_run()
request("http://example.com") |> req_user_agent("MyString") |> req_dry_run()
# If you're wrapping in an API in a package, it's polite to set the
# user agent to identify your package.
request("http://example.com") |>
req_user_agent("MyPackage (http://mypackage.com)") |>
req_dry_run()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.