抓包到的请求是这样的:
-----------------------------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
1
vZexc0m 2017-09-10 13:49:03 +08:00 1
其余字段放在放在 data 里面
|