globeHttp

get(url, timeout)

Send get request.

Parameters:

  • url (string).

  • timeout (number).

Example Usage:

-- Example code showing how to use the function
local response = encoding.bytesToString(http.get("http://ip-api.com/json/24.48.0.1", 5000), "UTF-8")
local js = json.parse(response)
player.addMessage(js.country)

get_with_headers(url, headers)

Send get request.

Parameters:

  • url (string).

  • headers (table).

Example Usage:

get_async_callback(url, function(response, error))

Send async get request.

Parameters:

  • url (string).

  • function (function).

Example Usage:

get_async_with_headers_callback(url, headers, function(response, error))

Send async get request.

Parameters:

  • url (string).

  • headers (table).

  • function (function).

Example Usage:

post_async_with_headers_callback(url, headers, json_body, function(response, error))

Send async post request.

Parameters:

  • url (string).

  • headers (table).

  • json_body (string).

  • function (function).

Example Usage:

Last updated