wiki.sine.space | sinespace

Scripting/SWebResponse

From wiki.sine.space
Revision as of 05:46, 17 February 2017 by Ashasekayi (Talk | contribs)

Jump to: navigation, search

The SWebResponse class returns the result of a HTTP GET/POST request

Fields

Error

string Error { get; }

Any error, will be empty or null if the request was successful

local response = function(data)

  if data.Error == "" or data.Error == nil then
    Space.Log("Data Loaded")
    Space.Log(data.Response)
  else
    Space.Log("Error Found")
  end

end


Response

string Response { get; }

The body text of the webpage response if error is empty or null

local response = function(data)

  if data.Error == "" or data.Error == nil then
    Space.Log(data.Response)
  end

end