Node.js-生成多部分/表单数据 [英] Node.js - generate multipart/form-data
本文介绍了Node.js-生成多部分/表单数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否存在一个Node.js库,用于以以下形式生成多部分/表单数据内容?
Is there a Node.js library for generating multipart/form-data content in the following form?
------------------------------7a9cd2dc11c1
Content-Disposition: form-data; name="to"
destination@email.com
------------------------------7a9cd2dc11c1
Content-Disposition: form-data; name="from"
recipient@email.com
------------------------------7a9cd2dc11c1
Content-Disposition: form-data; name="subject"
subject line
------------------------------7a9cd2dc11c1
Content-Disposition: form-data; name="text"
This content does not matter.
------------------------------7a9cd2dc11c1--
推荐答案
fermata 看起来可能是您正在寻找什么.在github页面上:
fermata looks like it might be what you're looking for. From the github page:
fermata.json("http://example.com/some/action").post({
'Content-Type':"multipart/form-data"
}, {
fileField: form.input.file || {data:nodeBuffer, name:"", type:""}
}, callback)
这篇关于Node.js-生成多部分/表单数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文