简体   繁体   English

Python request.get()

[英]Python requests.get()

response=requests.get(posturl,postData,headers)
print response.read()

I build the code,and debugger reports that 我构建代码,调试器报告

TypeError: get() takes exactly 1 argument (3 given)

How can I solve it? 我该如何解决?

You need to use requests.post to do POST request: 您需要使用requests.post来执行POST请求:

response=requests.get(posturl, postData, headers)

and to get content, use response.content (if you want byte string) or response.text (if you want unicode string): 要获取内容,请使用response.content (如果要字节字符串)或response.text (如果要unicode字符串):

print response.content

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM