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 Functions

HTTP.Get

Available since Version 1.1.

Performs an HTTP GET request.

Syntax

HTTP.Get( url, callback, options )

Arguments

  • url (string): The URL to send the GET request to.
  • callback (function): A function to call when the request completes. Receives a response object. See HTTP for the response object structure.
  • options (table, optional): Optional configuration for the request.
    • timeout (number): The maximum time in milliseconds to wait for a response. Defaults to 30000.

Return Values

No return values.

Examples

HTTP.Get("https://example.com/api/data", function(response)
    if response.ok then
        print(response.body)
    else
        print("Request failed: " .. (response.error or tostring(response.statusCode)))
    end
end)