# NOT RUN {
auth(user = "foo", pwd = "bar", auth = "basic")
auth(user = "foo", pwd = "bar", auth = "digest")
auth(user = "foo", pwd = "bar", auth = "ntlm")
auth(user = "foo", pwd = "bar", auth = "any")
# gssnegotiate auth
auth(NULL, NULL, "gssnegotiate")
# }
# NOT RUN {
# with HttpClient
(res <- HttpClient$new(
url = "https://httpbin.org/basic-auth/user/passwd",
auth = auth(user = "user", pwd = "passwd")
))
res$auth
x <- res$get()
jsonlite::fromJSON(x$parse("UTF-8"))
# with HttpRequest
(res <- HttpRequest$new(
url = "https://httpbin.org/basic-auth/user/passwd",
auth = auth(user = "user", pwd = "passwd")
))
res$auth
# }
Run the code above in your browser using DataLab