Network
HTTP Request
HTTP requests are executed by the robot-side proxy. Can be used to access HTTP services on the network where the robot control box is located.
- Function name: Method
httpunder [Robot] - Parameters:
- req: [HttpRequest] HTTP request
- Return: [HttpResponse] HTTP response
Example Program
req = {method = "GET", url = "http://127.0.0.1:8080/", headers = {}, body = ""}
res = lebai:http(req)
print(res.status)
req = {'method': 'GET', 'url': 'http://127.0.0.1:8080/', 'headers': {}, 'body': ''}
res = lebai.http(req)
print(res.status)
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "http", "params": [{"method": "GET", "url": "http://127.0.0.1:8080/", "headers": {}, "body": ""}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"status": 200, "headers": {}, "body": ""}, "id": 1 }
