Lua Class - http

http is a class in the Teverse Lua API that contains 0 properties, 4 methods and 0 events.

This class cannot be constructed, it is managed by Teverse.

Properties
Methods
delete( string url , string body , table ?headers , function ?callback )

Sends a DELETE request. If callback is provided, this function is nonblocking and returns nil. If callback is not provided, this function yields and returns statusCode, body.

CODE SAMPLE
http:delete("https://teverse.com/", "", {["header"] = "value"}, function(status, body)
    print("Result:", status)
end) --> 
get( string url , table ?headers , function ?callback )

Sends a GET request. If callback is provided, this function is nonblocking and returns nil. If callback is not provided, this function yields and returns statusCode, body.

CODE SAMPLE
http:get("https://teverse.com/", {["header"] = "value"}, function(status, body)
    print("Result:", status)
end) --> 
post( string url , string body , table ?headers , function ?callback )

Sends a POST request. If callback is provided, this function is nonblocking and returns nil. If callback is not provided, this function yields and returns statusCode, body.

CODE SAMPLE
http:post("https://teverse.com/", "", {["header"] = "value"}, function(status, body)
    print("Result:", status)
end) --> 
put( string url , string body , table ?headers , function ?callback )

Sends a PUT request. If callback is provided, this function is nonblocking and returns nil. If callback is not provided, this function yields and returns statusCode, body.

CODE SAMPLE
http:put("https://teverse.com/", "", {["header"] = "value"}, function(status, body)
    print("Result:", status)
end) --> 
Events

Some sections of our docs are maintained on github.