76 lines
2.0 KiB
Plaintext
76 lines
2.0 KiB
Plaintext
:sig
|
|
Request& context;
|
|
|
|
:ServerState* server
|
|
Contains the current server state
|
|
|
|
:StringMap params
|
|
All FastCGI server parameters
|
|
|
|
:StringMap get
|
|
The current request's GET variables
|
|
|
|
:StringMap post
|
|
The current request's POST variables
|
|
|
|
:StringMap cookies
|
|
Cookies that have been transmitted by the browser
|
|
|
|
:StringMap session
|
|
The current session
|
|
|
|
:String session_id
|
|
ID of the session cookie
|
|
|
|
:String session_name
|
|
Name of the session cookie
|
|
|
|
:DTree var
|
|
Variable user-defined data
|
|
|
|
:DTree cfg
|
|
Request-local configuration tree. Apps can keep structured configuration here and traverse it with `context.cfg.get_by_path("path/to/value")`.
|
|
|
|
:DTree call
|
|
Invocation or message-local structured data
|
|
|
|
:DTree connection
|
|
Broker-owned per-WebSocket-connection state. Inside `WS(Request& context)`, updates to this tree persist for the lifetime of that socket connection.
|
|
|
|
:std::vector<UploadedFile> uploaded_files
|
|
Files that have been uploaded in the current request
|
|
|
|
:StringMap header
|
|
Headers to be sent back to the browser
|
|
|
|
:StringList set_cookies;
|
|
Cookies that should be sent back to the browser
|
|
|
|
:context.set_status(s32 code[, String reason])
|
|
Sets the HTTP status line and updates `context.flags.status`. When `reason` is omitted, UCE uses a built-in standard reason phrase for common status codes.
|
|
|
|
:u64 random_seed
|
|
The current request's "random" noise generator seed
|
|
|
|
:u64 random_index
|
|
The current request's "random" noise generator index position
|
|
|
|
:bool flags.log_request
|
|
Whether the request should be logged
|
|
|
|
:Stats
|
|
u32 stats.bytes_written
|
|
f64 stats.time_init
|
|
f64 stats.time_start
|
|
f64 stats.time_end
|
|
|
|
:unit_render(String file_name, [Request& context])
|
|
Invokes another UCE file using the current or supplied request context
|
|
|
|
:see
|
|
>types
|
|
|
|
:related
|
|
**PHP:** `$_SERVER`, `$_GET`, `$_POST`, `$_COOKIE`, `$_SESSION`, `header()`, and `http_response_code()`
|
|
**JavaScript / Node.js:** Express `req` and `res`, Fetch `Request`, `Headers`, cookies or session middleware, and per-connection state in WebSocket handlers
|