Examples for 'crul::http-headers'


Working with HTTP headers

Aliases: http-headers

Keywords:

### ** Examples

## Not run: 
##D (x <- HttpClient$new(url = "https://hb.opencpu.org"))
##D 
##D # set headers
##D (res <- HttpClient$new(
##D   url = "https://hb.opencpu.org",
##D   opts = list(
##D     verbose = TRUE
##D   ),
##D   headers = list(
##D     a = "stuff",
##D     b = "things"
##D   )
##D ))
##D res$headers
##D # reassign header value
##D res$headers$a <- "that"
##D # define new header
##D res$headers$c <- "what"
##D # request
##D res$get('get')
##D 
##D ## setting content-type via headers
##D (res <- HttpClient$new(
##D   url = "https://hb.opencpu.org",
##D   opts = list(
##D     verbose = TRUE
##D   ),
##D   headers = list(`Content-Type` = "application/json")
##D ))
##D res$get('get')
## End(Not run)

[Package crul version 1.5.0 Index]