
See https://developer.mozilla.org/en-US/docs/Glossary/Response_header for example response headers and their purpose.
header(..., expose = FALSE, name = ...names(), value = ..1)
A 'header' object that can be passed to response()
.
A single key-value pair.
Allow javascript to read this header.
Explicitly set the name (key) in the key-value pair.
Explicitly set the value in the key-value pair.
library(webqueue)
header(name = 'Location', value = '/index.html')
Location <- '/index.html'
header(Location)
response(307L, header(Location = '/index.html'))
# Allow javascript to access a header value
header('x-user-id' = 100, expose = TRUE)
Run the code above in your browser using DataLab