[英]python requests: TypeError: __init__() got an unexpected keyword argument 'proxies'
I am using python 3.7 on cygwin. 我在cygwin上使用python 3.7。 the version of Requests is 3.22. 请求的版本是3.22。
Tim.Zwart@VIXION /c/c/U/t/D/e/cloud_server# python3.7 excelposttest.py
/usr/lib/python3.7/site-packages/requests/__init__.py
Traceback (most recent call last):
File "excelposttest.py", line 35, in <module>
req = requests.Request("POST", 'https://exceltocodeazure20190222112103.azurewebsites.net/api/Function1', data=data, headers=headers, proxies=proxiesspec)
TypeError: __init__() got an unexpected keyword argument 'proxies'
the relevant code is this: 相关代码是这样的:
req = requests.Request("POST", 'https://exceltocodeazure20190222112103.azurewebsites.net/api/Function1', data=data, headers=headers, proxies=proxiesspec)
The problem is the requests.request
method has almost the same name as requests.Request
, a class within the same module. 问题是requests.request
方法具有几乎相同的名称作为requests.Request
,同一模块内的一个类。 So misspelling by capitalizing the first letter does not lead to a function undefined
kind of error but instead to this. 因此,通过大写第一个字母拼写错误不会导致function undefined
的错误,而是导致错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.