Donut Team is a labor of love, built and maintained by a small group of passionate developers. We invest our own time and resources to offer our tools, mods, and web services completely free of charge.

We don't run ads, and we will never sell your data - period.

If you've enjoyed anything we've created, please consider supporting our work with a one-time or monthly donation via our Ko-fi page . Every contribution helps us continue building great experiences for the community.

Dismiss
  • Modding Tools
  • Simpsons Hit & Run Multiplayer Server
  • Lua API Reference

HTTP

Available since Version 1.1.

The HTTP table provides functions for making HTTP requests from Simpsons Hit & Run Multiplayer Server mods.

In order to use the HTTP table, the server must enable the WebRequests permission in their Server.yaml file:

modPermissions:
  webRequests: true

All HTTP requests are performed asynchronously. A callback function is called when the request completes.

Response Object

All HTTP functions accept an optional callback that receives a response object with the following fields:

Field Type Description
statusCode number The HTTP status code returned by the server.
ok boolean true if the request completed without error and returned a 2xx status code.
body string The response body. May be nil if the request failed.
error string An error message. Only present if the request failed.

Methods

Function Name Description
HTTP.Get Performs an HTTP GET request.
HTTP.Post Performs an HTTP POST request.
HTTP.Request Performs a fully customised HTTP request.