【发布时间】:2020-12-24 05:02:30
【问题描述】:
我目前正在开发一个使用 Flask-restful 的函数来调用 GET 函数以从另一个站点获取 QR 码。但出现以下错误:
requests.exceptions.SSLError: HTTPSConnectionPool(host='testing-site', port=443): url: /testing/getQR?clientID={clientID}&responseType={response-type}&source=PC_Browser&redirectURI ={redirect-url} (由 SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] 错误版本号 (_ssl.c:1122)')))
我的代码如下:
qr_request_body_web = {'clientID' : clientID, 'responseType' : 'code', 'source' : 'PC_Browser', 'redirectURI' : server_domain + authcallback_path}
def getQR():
response = requests.get('testing-site' + api_auth_getqr_path, params = qr_request_body_web, allow_redirects=True)
return redirect(response.url)
if __name__ == '__main__':
app.run(port=80, debug=True)
我可以在 Postman & Chrome 上调用 GET 函数,是否需要为 python 设置任何配置才能使其工作?非常感谢。
【问题讨论】:
标签: python-3.x flask openssl flask-restful restful-url