bestehen

bestehen

V2EX member #316724, joined on 2018-05-16 12:17:19 +08:00
Python 这种的报错啥问题
问与答  •  bestehen  •  Sep 3, 2018  •  Lastly replied by Sylv
1
Python 中处理 pdf 问题
Python  •  bestehen  •  Sep 4, 2018  •  Lastly replied by jiangbingo
1
Python 中的 pathlib 怎么用
Python  •  bestehen  •  Sep 2, 2018  •  Lastly replied by bestehen
5
sha-256 这种加
算法  •  bestehen  •  Aug 27, 2018  •  Lastly replied by bestehen
3
post man 模拟上传一个文件改成 Python 报错 空文件
Python  •  bestehen  •  Aug 26, 2018  •  Lastly replied by luozic
1
Python 通过 multipart 协议发送 post 请求 报错如下
问与答  •  bestehen  •  Aug 26, 2018  •  Lastly replied by bestehen
2
Python 如何 发送 multiipart 上传文件?
问与答  •  bestehen  •  Aug 24, 2018  •  Lastly replied by bestehen
3
bestehen's recent replies
踏实一点
Sep 2, 2018
Replied to a topic by bestehen Python Python 中的 pathlib 怎么用
@inframe 你说的官方文档是那个 piyi 的 homepage 吗?
Sep 2, 2018
Replied to a topic by bestehen Python Python 中的 pathlib 怎么用
@matrix273 解决了谢谢
Aug 27, 2018
Replied to a topic by bestehen 算法 sha-256 这种加
@silhouette 消息长度是啥
@xubeiyan 我换了 utf-8
但是传的文件是空
Aug 24, 2018
Replied to a topic by bestehen 问与答 Python 如何 发送 multiipart 上传文件?
网页源码是这样的

<form id="w0" class="form-horizontal" action="/report/add?_=1535094880131" method="post" enctype="multipart/form-data">
<input type="hidden" name="_csrf" value="4n_OPKuOaFi3F2pKZZwCPje9xQM4aIwKOZiHWUSoOSGnDqls7uo4HY5aAClc0nVhR_OIMloA-D5L3rYGNMdLVA=="><div class="form-group field-reportform-url">
<label class="control-label col-sm-3" for="reportform-url">上传报告</label>
<div class="col-sm-6">
<input type="hidden" name="ReportForm[url]" value=""><input type="file" id="reportform-url" class="report_pdf_new" name="ReportForm[url]">
<p class="help-block help-block-error "></p>
</div>
Aug 24, 2018
Replied to a topic by bestehen 问与答 Python 如何 发送 multiipart 上传文件?
@lieh222 返回的是 none
我现在是这样写的
files=[("ReportForm[url]",('齐家网 COO 毛新勇:《未来平台赋能是必然,但要真刀真枪才有意义》-18 页.pdf',open(file,'rb'),'Content-Type: application/pdf'))]
data={"_csrf":csrf_token}
headers=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,files=files,data=data,headers=headers)
print(response.request.body)
主要这个网站我好想发布了图片,只能打字
Aug 22, 2018
Replied to a topic by bestehen Python Python 报错 如何解决?
@xiaobai987 一边去
@huaerxiela 我说调用 nodejs 不是 js
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1047 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 28ms · UTC 23:32 · PVG 07:32 · LAX 16:32 · JFK 19:32
♥ Do have faith in what you're doing.