ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. callRemote

Function

callRemote

ServerResourcesIdentical to MTA:SA

Calls a function exposed by another server over HTTP (arguments go as JSON in a POST request). In the current server version the function does not send the request and returns false; use fetchRemote with toJSON instead.

Syntax

bool callRemote(string url [, any ...])

Arguments

urlstring
The address.
...any, optional
Arguments and a function(result, errno) callback.

Returns

Currently false.

Example

fetchRemote("https://example.com/api/ranking", function(data, errno)
    if errno == 0 then outputServerLog(data) end
end, toJSON({ player = "Jan", score = 120 }))

See also