local rest api 的请求放到命令行或者python执行报错

在测试网页是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

可能是少了:

'Content-Type': 'text/markdown'

谢谢 但不是这个问题

SSL routines 使用到https了?用https 27124試看看?

參考看看: [Obs#105] Local REST API外掛:提供Obsidian HTTP調用整合服務 - YouTube

sudo apt update

是过了没用, 谢谢

不是端口的问题, http和https都试过, 视频是windows 我这个是linux可能是这个问题