繁体   English   中英

Python request.get()

[英]Python requests.get()

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

我构建代码,调试器报告

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

我该如何解决?

您需要使用requests.post来执行POST请求:

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

要获取内容,请使用response.content (如果要字节字符串)或response.text (如果要unicode字符串):

print response.content

暂无
暂无

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

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