import requests
url1='http://192.168.1.52:8080/api/login'
r = requests.post(url1, params={'username':'' , 'password':''})
print(r.text)
filehandle = open( r'R:\sss.txt' )
heart_dict = {
'X-Auth': r.text
}
url2='http://192.168.1.52:8080/api/resources/sdcard/云/sss23.txt'
r = requests.post( url2 , headers = heart_dict , data ={'override': False} ,files = {'upload':filehandle} , timeout = 500 )
传之前的txt内容:
1213
手机的txt内容:
--68e01d00598cb538d705b8904bbf4d0b
Content-Disposition: form-data; name="override"
False
--68e01d00598cb538d705b8904bbf4d0b
Content-Disposition: form-data; name="upload"; filename="sss.txt"
1213
--68e01d00598cb538d705b8904bbf4d0b--
中间漏了哪一步呢?