The request_rec is mapped in as a userdata. It has a metatable
which lets you do useful things with it. For the most part it
has the same fields as the request_rec struct, many of which are writable as
well as readable. (The table fields' content can be changed, but the
fields themselves cannot be set to different tables.)
allowoverrides |
string |
no |
The AllowOverride options applied to the current request. |
ap_auth_type |
string |
no |
If an authentication check was made, this is set to the type
of authentication (f.x. basic ) |
args |
string |
yes |
The query string arguments extracted from the request
(f.x. foo=bar&name=johnsmith ) |
assbackwards |
boolean |
no |
Set to true if this is an HTTP/0.9 style request
(e.g. GET /foo (with no headers) ) |
auth_name |
string |
no |
The realm name used for authorization (if applicable). |
banner |
string |
no |
The server banner, f.x. Apache HTTP Server/2.4.3 openssl/0.9.8c |
basic_auth_pw |
string |
no |
The basic auth password sent with this request, if any |
canonical_filename |
string |
no |
The canonical filename of the request |
content_encoding |
string |
no |
The content encoding of the current request |
content_type |
string |
yes |
The content type of the current request, as determined in the
type_check phase (f.x. image/gif or text/html ) |
context_prefix |
string |
no |
|
context_document_root |
string |
no |
|
document_root |
string |
no |
The document root of the host |
err_headers_out |
table |
no |
MIME header environment for the response, printed even on errors and
persist across internal redirects |
filename |
string |
yes |
The file name that the request maps to, f.x. /www/example.com/foo.txt. This can be
changed in the translate-name or map-to-storage phases of a request to allow the
default handler (or script handlers) to serve a different file than what was requested. |
handler |
string |
yes |
The name of the handler that should serve this request, f.x.
lua-script if it is to be served by mod_lua. This is typically set by the
AddHandler or SetHandler
directives, but could also be set via mod_lua to allow another handler to serve up a specific request
that would otherwise not be served by it.
|
headers_in |
table |
yes |
MIME header environment from the request. This contains headers such as Host,
User-Agent, Referer and so on. |
headers_out |
table |
yes |
MIME header environment for the response. |
hostname |
string |
no |
The host name, as set by the Host: header or by a full URI. |
is_https |
boolean |
no |
Whether or not this request is done via HTTPS |
is_initial_req |
boolean |
no |
Whether this request is the initial request or a sub-request |
limit_req_body |
number |
no |
The size limit of the request body for this request, or 0 if no limit. |
log_id |
string |
no |
The ID to identify request in access and error log. |
method |
string |
no |
The request method, f.x. GET or POST . |
notes |
table |
yes |
A list of notes that can be passed on from one module to another. |
options |
string |
no |
The Options directive applied to the current request. |
path_info |
string |
no |
The PATH_INFO extracted from this request. |
port |
number |
no |
The server port used by the request. |
protocol |
string |
no |
The protocol used, f.x. HTTP/1.1 |
proxyreq |
string |
yes |
Denotes whether this is a proxy request or not. This value is generally set in
the post_read_request/translate_name phase of a request. |
range |
string |
no |
The contents of the Range: header. |
remaining |
number |
no |
The number of bytes remaining to be read from the request body. |
server_built |
string |
no |
The time the server executable was built. |
server_name |
string |
no |
The server name for this request. |
some_auth_required |
boolean |
no |
Whether some authorization is/was required for this request. |
subprocess_env |
table |
yes |
The environment variables set for this request. |
started |
number |
no |
The time the server was (re)started, in seconds since the epoch (Jan 1st, 1970) |
status |
number |
yes |
The (current) HTTP return code for this request, f.x. 200 or 404 . |
the_request |
string |
no |
The request string as sent by the client, f.x. GET /foo/bar HTTP/1.1 . |
unparsed_uri |
string |
no |
The unparsed URI of the request |
uri |
string |
yes |
The URI after it has been parsed by httpd |
user |
string |
yes |
If an authentication check has been made, this is set to the name of the authenticated user. |
useragent_ip |
string |
no |
The IP of the user agent making the request |