Skip to main content
Requests run in the background and never block the game. Your callback fires on a later frame, once the response has arrived.
A script can send anything it can read to any address. Read a script before you run it, the same as you would with any code from someone else.

Get

Post

Sends Content-Type: application/x-www-form-urlencoded unless you set your own in opts.headers.

Opts

Host, Connection, Content-Length, and Accept-Encoding are set automatically. The timeout is capped at 5000 ms. Header names and values cannot contain newlines.

Response

ok describes the transport, not the result. A 404 that arrived is ok = true with status = 404. A DNS failure or timeout is ok = false with error set.

Limits

Redirects are not followed. Only IPv4 hosts resolve. Use json.Decode for JSON responses. Callable at load time and from any callback. Pending requests are dropped when your script reloads or unloads, so a callback never runs against a dead script.