Как можно разобрать `multipart / mixed` в node.js? - PullRequest
0 голосов
/ 30 мая 2019

Я вижу много модулей в node.js, таких как busboy, multer, грозные, но они не могут разобрать multipart/mixed body.

Пример запроса multipart/mixed в node.js

--batchbatch
Content-Type: multipart/mixed; boundary=changeset1

--changeset1
Content-Type: application/http
Content-Transfer-Encoding: binary

POST data HTTP/1.1
Content-Type: application/json
Content-ID: ID1
Content-Length: 10000

{
"Name": "ddd",
"data1": "3",
"data2": "40", 
"data3": "OPPT",
"data3":"D1000",
"dat4": "D1000"
}


--changeset1--

--batchbatch
Content-Type: multipart/mixed; boundary=changeset2

--changeset2
Content-Type: application/http
Content-Transfer-Encoding: binary

PATCH data/32451 HTTP/1.1
Content-Type: application/json
Content-ID: ID1
Content-Length: 10000

{
"code": "3"
}

--changeset2--
--batchbatch
Content-Type: multipart/mixed; boundary=changeset3

--changeset3
Content-Type: application/http
Content-Transfer-Encoding: binary

DELETE /data/2345 HTTP/1.1


--changeset3--
--batchbatch--
...