Arma 3 Scripting

webRequest

  • dev branch
  • Arma 3 v2.24

Command · Markdown · JSON · original wiki page

Description

Create a web request returning an SQF promise, allowing communication with web servers in game.

Note

See WebAPI for a full tutorial.

Syntax

webRequest request

Parameters:

Returns: Script Handle - a promise

Examples

Example 1

spawn {
    private _handle = webRequest #{
        "type": "http",
        //"method": "GET", "GET" is default
        "origin": "test",
        "url": "https://myip.wtf/text"
    };
    private _result = waitUntil _handle; // suspend until it is ready
    _result params ["_request", "_result"];
    systemChat format ["My IP is: %1", _result get "body"];
};

See also

callExtension · connectToServer