在测试网页是ok的.
但是如果用python调用返回的是502的错误.
def LocalRestApiTest():
import requests
url = 'http://127.0.0.1:27123/commands/'
headers = {
'accept': 'application/json',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-US;q=0.7,ja;q=0.6,zh-TW;q=0.5',
'Authorization': 'Bearer d290a656dxxx',
'Connection': 'keep-alive',
'Host': '127.0.0.1:27123',
}
response = requests.get(url, headers=headers)
print('test')
命令行 curl 调用是:
http: 无返回内容
https: curl: (35) error:0A000126:SSL routines::unexpected eof while reading
系统是Ubuntu22