webmcp
view framework/env/request/get_header.lua @ 456:59a6f4851764
Added request.get_header{...} function
author | jbe |
---|---|
date | Mon Jul 25 22:27:17 2016 +0200 (2016-07-25) |
parents | |
children | 17a2b7e1c463 |
line source
1 --[[--
2 value = -- value of header as string containing comma (and space) separated values
3 request.get_header(
4 key -- name of header, e.g. "Authorization"
5 )
7 Returns the value of an HTTP header sent by the client. If the header occurs multiple times, the values are concatenated with a comma and zero or more space characters (e.g. "value1, value2").
9 --]]--
11 function request.get_header(key)
12 return request._http_request.headers_csv_string[key]
13 end