简体   繁体   English

python请求:TypeError:__ init __()得到一个意外的关键字参数'proxies'

[英]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.

相关问题 TypeError at &#39;&#39; __init__() 得到一个意外的关键字参数 &#39;&#39; - TypeError at '' __init__() got an unexpected keyword argument '' Python openpyxl TypeError:__init __()获得了意外的关键字参数&#39;pivotButton&#39; - Python openpyxl TypeError: __init__() got an unexpected keyword argument 'pivotButton' Telethon Python TypeError:__init__() 得到了一个意外的关键字参数“hash” - Telethon Python TypeError: __init__() got an unexpected keyword argument 'hash' Python Flask - TypeError: __init__() 得到了一个意外的关键字参数“lable” - Python Flask - TypeError: __init__() got an unexpected keyword argument 'lable' Python 3.5:TypeError:__ init __()得到了一个意外的关键字参数'nosigint' - Python 3.5 : TypeError: __init__() got an unexpected keyword argument 'nosigint' 点安装请求错误TypeError:__init __()得到了意外的关键字参数&#39;max_retries&#39; - Pip install requests error TypeError: __init__() got an unexpected keyword argument 'max_retries' 为什么我得到了一个 TypeError: __init__() 在 python sklearn 中得到了一个意外的关键字参数“outer_cv”? - Why I got an TypeError: __init__() got an unexpected keyword argument 'outer_cv' in python sklearn? Scrapy错误:TypeError:__ init __()得到一个意外的关键字参数&#39;deny&#39; - Scrapy Error: TypeError: __init__() got an unexpected keyword argument 'deny' TypeError:__init __()得到了意外的关键字参数错误 - TypeError: __init__() got an unexpected keyword argument error TypeError:__ init __()在argparse中有一个意外的关键字参数&#39;type&#39; - TypeError: __init__() got an unexpected keyword argument 'type' in argparse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM