import requests
#文件上传
#测试接口
url = 'https://httpbin.org/post'
files = {
'file':open('cookies.txt','r')
}
response = requests.post(url,files=files)
print(response.status_code)
print(response.text)
import requests
#文件上传
#测试接口
url = 'https://httpbin.org/post'
files = {
'file':open('cookies.txt','r')
}
response = requests.post(url,files=files)
print(response.status_code)
print(response.text)
本文标题:网络爬虫:requests模块应用3--post--file
本文链接:https://www.haomeiwen.com/subject/ryjblqtx.html
网友评论