Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

authenticate

Use http authentication.


Description

It's not obvious how to turn authentication off after using it, so I recommend using custom handles with authentication.

Usage

authenticate(user, password, type = "basic")

Arguments

user

user name

password

password

type

type of HTTP authentication. Should be one of the following types supported by Curl: basic, digest, digest_ie, gssnegotiate, ntlm, any. It defaults to "basic", the most common type.

See Also

Other config: add_headers(), config(), set_cookies(), timeout(), use_proxy(), user_agent(), verbose()

Examples

GET("http://httpbin.org/basic-auth/user/passwd")
GET(
  "http://httpbin.org/basic-auth/user/passwd",
  authenticate("user", "passwd")
)

httr

Tools for Working with URLs and HTTP

v1.4.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.