Performs a http request using the specified parameters and returns the http response in a callback.


PerformHttpRequest(string url, function callback[, string method = 'GET', string data = '', table headers = {}])

Required arguments

  • url: A string of the URL to request.
  • callback: The callback function to call after the request is finished.

Optional arguments

  • method: The HTTP method to use.
  • data: A string of data to send with the request.
  • headers: A table of request headers.


PerformHttpRequest("", function (errorCode, resultData, resultHeaders, errorData)
  print("Returned error code:" .. tostring(errorCode))
  print("Returned data:" .. tostring(resultData))
  print("Returned result Headers:" .. tostring(resultHeaders))
  print("Returned error data:" .. tostring(errorData))
Last modified June 24, 2023: Update (2028850)