Scripting/SWebResponse

From sine.space Wiki
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 == 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 == nil then
    Space.Log(data.Response)
  end

end