python interface to upload files

1. As the company do interface testing, met upload files, has been engaged in a long time, plus the reason turned out to be the head of the 
DEF test_79 (Self):

'' 'import profile' ''
Request = E [ 'mysqlshujuku']
url Request = [ 'url12']
Data = { "name": "2132131", "Comment": "2132131", "Version": "mysql5.6", "local_id": "Beijing",
"PROJECT_ID": "0 "}
Files = { 'template_file': Open (R & lt" C: \ the Users \ 00 \ Desktop \ test.txt ", 'RB')}
REP = requests.request (" the POST ", URL, Data = Data, Cookies = Cookies, Files = Files, Verify = False) .json ()
Print (REP)

 

 

Guess you like

Origin www.cnblogs.com/xuzhongtao/p/11418211.html