getRemoteRequestInfo | Multi Theft Auto: Wiki Skip to content

getRemoteRequestInfo

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Gets informations of an fetchRemote or callRemote request info.

Syntax

table getRemoteRequestInfo ( request theRequest, [ int postDataLength = 0 [, bool includeHeaders = false ] ] )
Required Arguments
  • theRequest: returned from fetchRemote , callRemote or getRemoteRequests
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • postDataLength (default: 0 [, bool includeHeaders = false ]): MISSING_PARAM_DESC

Returns

  • table: value

Returns a table when valid, false otherwise The table contains:

Code Examples

shared

This example gets infos about all pending requests and prints them in debugscript

function CMD_requestInfo(player, _, resourceName)
local res = resourceName and getResourceFromName(resourceName) or not resourceName and nil
if(res == false) then
outputServerLog("There is no resource named '" .. resourceName .. "'")
return
elseif(res and getResourceState(res) ~= "running") then
outputServerLog("The provided resource '" .. resourceName .. "' is not running")
return
end
local requests = getRemoteRequests(res)
for _, request in ipairs(requests) do
local requestInfo = getRemoteRequestInfo(request)
if(requestInfo) then
iprint(requestInfo)
end
end
end
addCommandHandler("requestinfo", CMD_requestInfo)