Description Usage Arguments Details Examples
To get the values of request header fields [
may be used to get a
single or multiple values respectively. Request field names are
case-sensitive.
1 2 | ## S3 method for class 'request'
x[field]
|
x |
A |
field |
An HTTP request header field name. |
For more information regarding HTTP request header fields please refer to https://tools.ietf.org/html/rfc2616#section-5.3.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | req <- request()
req['Accept'] # NULL
req['From'] # NULL, boring
mkup_checkin <- mockup(
route(
'POST',
'^$',
function(req) {
print(req[['Accept']])
print(req[['From']])
response()
}
)
)
# More interesting output
mkup_checkin(
'POST',
'/',
headers = list(
Accept = 'text/html',
From = 'Russia w/ Love'
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.