协议框架

远程调用服务采用 HTTP 框架,部分协议需要验证调用者身份

控制客户端调用格式

http方法:[POST或者GET] /[命令路径] HTTP/1.1    
Host: [服务端ip]    
Connection: close    
Content-Length: [数据长度]
其他参数: [header]

lua 调用实例

local response_body = {}
    http = require("socket.http")
    http.TIMEOUT=1
    local response_body = {}
    local rep , code = http.request{
        url = "http://192.168.0.2:50005/status",
        headers=   
        {  
          --触动专业版 iOS 无需写入验证串
            ["auth"] = Auth,
        }, 
        sink = ltn12.sink.table(response_body),
    }
Copyright 北京帮你玩科技有限公司 2020 all right reserved,powered by Gitbook该文章修订时间: 2020-03-26 13:07:07

results matching ""

    No results matching ""