annotate 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  | 
 
 | rev | 
   line source | 
| 
jbe@456
 | 
     1 --[[--
 | 
| 
jbe@456
 | 
     2 value =              -- value of header as string containing comma (and space) separated values
 | 
| 
jbe@456
 | 
     3 request.get_header(
 | 
| 
jbe@456
 | 
     4   key                -- name of header, e.g. "Authorization"
 | 
| 
jbe@456
 | 
     5 )
 | 
| 
jbe@456
 | 
     6 
 | 
| 
jbe@456
 | 
     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").
 | 
| 
jbe@456
 | 
     8 
 | 
| 
jbe@456
 | 
     9 --]]--
 | 
| 
jbe@456
 | 
    10 
 | 
| 
jbe@456
 | 
    11 function request.get_header(key)
 | 
| 
jbe@456
 | 
    12   return request._http_request.headers_csv_string[key]
 | 
| 
jbe@456
 | 
    13 end
 |