Gly Game Engine 0.0.11
Game engine in lua
Loading...
Searching...
No Matches
Http

Functions

local function fast ()
 reduced response
 
local function body (content)
 
local function param (name, value)
 
local function header (name, value)
 
local function success (handler_func)
 
local function failed (handler_func)
 
local function error (handler_func)
 

Detailed Description

Precondition
require http
Methods
  • std.http.get
  • std.http.head
  • std.http.post
  • std.http.put
  • std.http.delete
  • std.http.patch
Example
  • local handlers
    std.http.get('http://pudim.com.br')
    :success(function()
    print('2xx callback')
    end)
    :failed(function()
    print('4xx / 5xx callback')
    end)
    :error(function()
    print('eg. to many redirects')
    end)
    :run()
    local function success(handler_func)
    local function error(handler_func)
    local function failed(handler_func)
  • global handler
    local function http(std, game)
    if std.http.error then
    print('eg. https is not supported')
    end
    if std.http.ok then
    print('2xx status')
    end
    if std.http.status > 400 then
    print('2xx / 5xx status')
    end
    end

Function Documentation

◆ body()

local function body ( content )

◆ error()

local function error ( handler_func )

◆ failed()

local function failed ( handler_func )

◆ fast()

local function fast ( )

disconnect when receiving status

◆ header()

local function header ( name ,
value  )

◆ param()

local function param ( name ,
value  )

◆ success()

local function success ( handler_func )