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

http-headers

Working with HTTP headers


Description

Working with HTTP headers

Examples

## Not run: 
(x <- HttpClient$new(url = "https://httpbin.org"))

# set headers
(res <- HttpClient$new(
  url = "https://httpbin.org",
  opts = list(
    verbose = TRUE
  ),
  headers = list(
    a = "stuff",
    b = "things"
  )
))
res$headers
# reassign header value
res$headers$a <- "that"
# define new header
res$headers$c <- "what"
# request
res$get('get')

## setting content-type via headers
(res <- HttpClient$new(
  url = "https://httpbin.org",
  opts = list(
    verbose = TRUE
  ),
  headers = list(`Content-Type` = "application/json")
))
res$get('get')

## End(Not run)

crul

HTTP Client

v1.1.0
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>)
Initial release

We don't support your browser anymore

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