Python uploads files through multipart protocol post

< form id= "w0" class= "form-horizontal" action= "/ report/add?_=1535094880131" method= "post" enctype= "multipart/form-data" >
< input type= "hidden" name= "_ csrf" value= "4nOPKuOaFi3F2pKZwCPje9xQM4aIwKOZiHWUSoSGnDqls7uo4HY5aAClc0nVhRust OIMloA "reportform-url" class= "report_pdf_new" name= "ReportForm [url]" >
< p class= "help-block help-block-error" >


< / div >

this is the source code of the web page. I use the following method to write, why did the upload fail

files= ["ReportForm [url]", ("Qijia net COO Mao Xinyong: "Future platform empowerment is inevitable, but it only makes sense if it is a real knife and gun"-18 pages. Pdf", str (open (file,"rb"). Read ()), "application/pdf")]

Data={"_csrf":csrf_token}

headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
        }

response=requests.post(url=url,cookies=cookies,data=Data,headers=headers)
print(response.request.body)-sharp-sharp-sharp 



Apr.28,2021

I really don't understand your question, what exactly are you asking?
doesn't understand the intent of your code either.

recommend a url:
python-requests.org/zh_CN/latest/user/quickstart.html-sharppost-multipart-encoded" rel=" nofollow noreferrer "> http://docs.python-requests.o.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9aa74-17f2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9aa74-17f2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?