getHeaders

Top  Previous  Next

Returns all the request headers for this page.

Definition

headers = getHeaders()

 

headers is a table of key value pairs representing the request headers.

Example

local headers = getHeaders()

 

for key,value in pairs(headers) do

 print(key, value)

end

 

This would print for example

 

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

Host: localhost

Cache-Control: max-age=0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.16 (KHTML, like Gecko) Chrome/24.0.1297.0 Safari/537.16

Connection: keep-alive

Accept-Language: en-US,en;q=0.8

Accept-Encoding: gzip,deflate,sdch

Alternative name

headers = webserver:GetHeaders()

 

Provided for Girder 5 compatibility.

Availability

Lua context during page load.