1 回答

TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊
如果我對(duì)您的理解正確,那么您想從HTTP / REST控制臺(tái)手動(dòng)編寫一個(gè)多部分請(qǐng)求。分段格式很簡單;簡短的介紹可以在HTML 4.01規(guī)范中找到。您需要提出一個(gè)邊界,即在內(nèi)容中找不到的字符串HereGoes。您設(shè)置請(qǐng)求標(biāo)頭Content-Type: multipart/form-data; boundary=HereGoes。然后,這應(yīng)該是有效的請(qǐng)求正文:
--HereGoes
Content-Disposition: form-data; name="myJsonString"
Content-Type: application/json
{"foo": "bar"}
--HereGoes
Content-Disposition: form-data; name="photo"
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
<...JPEG content in base64...>
--HereGoes--
添加回答
舉報(bào)