Skip to content

Override the default RCurl user agent of NULL

Usage

user_agent(agent)

Arguments

agent

string giving user agent

See also

Examples

GET("http://httpbin.org/user-agent")
#> Response [http://httpbin.org/user-agent]
#>   Date: 2022-08-17 14:42
#>   Status: 200
#>   Content-Type: application/json
#>   Size: 61 B
#> {
#>   "user-agent": "libcurl/7.68.0 r-curl/4.3.2 httr/1.4.4"
#> }
GET("http://httpbin.org/user-agent", user_agent("httr"))
#> Response [http://httpbin.org/user-agent]
#>   Date: 2022-08-17 14:42
#>   Status: 200
#>   Content-Type: application/json
#>   Size: 27 B
#> {
#>   "user-agent": "httr"
#> }