网络

HTTP 请求

由机器人侧代理执行 HTTP 请求。可用于访问机器人机箱所在网络的 HTTP 服务。

示例程序

req = {method = "GET", url = "http://127.0.0.1:8080/", headers = {}, body = ""}
res = lebai:http(req)
print(res.status)
JSON-RPC
// 请求:
{ "jsonrpc": "2.0", "method": "http", "params": [{"method": "GET", "url": "http://127.0.0.1:8080/", "headers": {}, "body": ""}], "id": 1 }
// 响应:
{ "jsonrpc": "2.0", "result": {"status": 200, "headers": {}, "body": ""}, "id": 1 }