Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我能';由于Python中的SSL错误,无法发出POST请求_Python_Api_Ssl_Post - Fatal编程技术网

我能';由于Python中的SSL错误,无法发出POST请求

我能';由于Python中的SSL错误,无法发出POST请求,python,api,ssl,post,Python,Api,Ssl,Post,我真的在努力解决这个问题。以下是我的错误: ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123) 在处理上述异常期间,发生了另一个异常: raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pixe.la

我真的在努力解决这个问题。以下是我的错误:

ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)
在处理上述异常期间,发生了另一个异常:

raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pixe.la', port=443): Max retries exceeded with url: /v1/users (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='pixe.la', port=443): Max retries exceeded with url: /v1/users (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))
在处理上述异常期间,发生了另一个异常:

raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pixe.la', port=443): Max retries exceeded with url: /v1/users (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='pixe.la', port=443): Max retries exceeded with url: /v1/users (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))
我的代码是:

import requests
pixela_endpoint = "https://pixe.la/v1/users"
user_params = {
  "token": "Odf8DE8gBq0W",
  "username": "gael",
  "agreeTermsOfService": "yes",
  "notMinor": "yes",
 }
 response = requests.post(url=pixela_endpoint, json=user_params, verify=False)
 print(response.text)

我没有答案,但它对我有效,所以你的代码没有任何根本性的错误。我知道如果您使用本地代理等进行调试,可能会发生这种情况。这里是这样吗?对我来说很好,您的
请求
模块版本是什么?您是否配置了任何代理?您正在使用哪个版本的OpenSSL,即
python-c'导入ssl的输出是什么;打印(ssl.OPENSSL_版本)
?它是否与同一台机器上的其他客户端(curl、wget、browser…)一起工作?@Kemp我不知道(我是初学者)是否有本地代理。我如何检查它?@PouyaEsmaeili请求版本:2.25.1