See https://developer.mozilla.org/en-US/docs/Glossary/Response_header for example response headers and their purpose.
Usage
header(..., expose = FALSE, name = ...names(), value = ..1)
Value
A 'header' object that can be passed to response()
.
Examples
library(webqueue)
header(name = 'Location', value = '/index.html')
#> Location: /index.html
Location <- '/index.html'
header(Location)
#> Location: /index.html
response(307L, header(Location = '/index.html'))
#> HTTP/1.1 307 Temporary Redirect
#> Location: /index.html
#>
#> Temporary Redirect
# Allow javascript to access a header value
header('x-user-id' = 100, expose = TRUE)
#> x-user-id: 100
#> Access-Control-Expose-Headers: x-user-id