GetRemoteRequestInfo
Jump to navigation
Jump to search
getRemoteRequestInfo
Returns the current state of an HTTP request owned by the current server-side resource.
Syntax
table|false getRemoteRequestInfo(number requestId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
requestId |
number |
yes | The identifier returned by requestRemote.
|
Returns
Returns a table containing requestId, state, url, elapsedMs, and cancelRequested, or false when the request does not exist or belongs to another resource.
Examples
Inspect a pending request:
local info = getRemoteRequestInfo(requestId)
if info then
outputDebugString("HTTP request is " .. info.state)
end
Notes
- Available only in server-side resource scripts.
- The
statevalue isqueued,running, orcompleted. - Completed request records are removed after their callback is dispatched, so this function is intended for pending-request diagnostics and cancellation UI.