简体   繁体   中英

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:

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):

print response.content

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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