GetRemoteRequestInfo

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 12:48, 24 August 2026 by QCherry (talk | contribs) (Document asynchronous server-side HTTP API)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 state value is queued, running, or completed.
  • Completed request records are removed after their callback is dispatched, so this function is intended for pending-request diagnostics and cancellation UI.