抓包到的请求是这样的:
-----------------------------13151347596532282191711782459
Content-Disposition: form-data; name="fid"
1
-----------------------------13151347596532282191711782459
Content-Disposition: form-data; name="moduleid"
5
-----------------------------13151347596532282191711782459
Content-Disposition: form-data; name="from"
album
-----------------------------13151347596532282191711782459
Content-Disposition: form-data; name="old"
-----------------------------13151347596532282191711782459
Content-Disposition: form-data; name="isremote"
0
-----------------------------13151347596532282191711782459
Content-Disposition: form-data; name="remote"
http://
-----------------------------13151347596532282191711782459
Content-Disposition: form-data; name="upalbum"; filename="\B0·Ұͺ\D5ͼ.png"
Content-Type: image/png
python 代码:
import requests
multipart_form_data = {
'upalbum': ('111.png', open('1.png', 'rb'), 'image/png'),
'fid': ('', ''),
'muduleid': ('', '5'),
'from': ('', 'album'),
'old': ('', ''),
'isremote': ('', '0'),
'remote': ('', 'http://')
}
requests.post('http://127.0.0.1:8888', files=multipart_form_data)
然后在 fiddle 中看到模拟的请求少了几个 field:
--9b67b0c1b58b473d86ca619bac4bdd0d
Content-Disposition: form-data; name="from"; filename=""
album
--9b67b0c1b58b473d86ca619bac4bdd0d
Content-Disposition: form-data; name="fid"; filename=""
--9b67b0c1b58b473d86ca619bac4bdd0d
Content-Disposition: form-data; name="upalbum"; filename="111.png"
Content-Type: image/png
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.