9--! @
short reduced response
10--! @brief disconnect when receiving status
16local function
body(self, content)
17 self.body_content=content
21local function
param(self, name, value)
22 local index =
#self.param_list + 1
23 self.param_list[index] = name
24 self.param_dict[name] = value
28local function
header(self, name, value)
29 local index = #self.header_list + 1
30 self.header_list[index] = name
31 self.header_dict[name] = value
35local function
success(self, handler_func)
36 self.success_handler = handler_func
40local function
failed(self, handler_func)
41 self.failed_handler = handler_func
45local function
error(self, handler_func)
46 self.error_handler = handler_func
57 if not callback_handler then
58 callback_handler = function() end
72 callback_handler = callback_handler,
73 success_handler = function (
std,
game) end,
74 failed_handler = function (
std,
game) end,
75 error_handler = function (
std,
game) end,
90 protocol_handler = protocol_handler
93 self.promise = function()
97 self.resolve = function()
101 self.set = function (key, value)
108 self:protocol_handler()
113 self.callback_handler(self.
std, self.
game)
116 self.success_handler(self.
std, self.
game)
118 self.error_handler(self.
std, self.
game)
120 self.failed_handler(self.
std, self.
game)
142 local protocol_handler = protocol.handler
153 if protocol.install then
155 event = m and m.event
local function stop(self)
local function resume(self)
local function require(std, game, application)
local function reset(self)
local function success(self, handler_func)
local function header(self, name, value)
local function body(self, content)
local function error(self, handler_func)
local function fast(self)
reduced response
local function param(self, name, value)
local function failed(self, handler_func)
local function http(std, game)
local function install(std, game, application, protocol)