From 1a2ff9c3d1ea012c0a7c6d2f8c09963a9c3b8a54 Mon Sep 17 00:00:00 2001 From: Ben Carp Date: Tue, 15 Mar 2022 07:53:11 +0200 Subject: [PATCH] multipart/form-data playground (#4465) * adding toFormData test * adding toFormData * initial multipart-FormData playground * formdata playground title * Fix examples/postMultipartFormData/server.js to the examples/**/server.js format, and so event end runs. Co-authored-by: Jay --- examples/postMultipartFormData/index.html | 131 ++++++++++++++++++++++ examples/postMultipartFormData/server.js | 13 +++ 2 files changed, 144 insertions(+) create mode 100644 examples/postMultipartFormData/index.html create mode 100644 examples/postMultipartFormData/server.js diff --git a/examples/postMultipartFormData/index.html b/examples/postMultipartFormData/index.html new file mode 100644 index 0000000..ac35060 --- /dev/null +++ b/examples/postMultipartFormData/index.html @@ -0,0 +1,131 @@ + + + + axios - post example + + + + + +

Post multipart/form-data

+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+ + + + +
+
+ +
+ + + + + diff --git a/examples/postMultipartFormData/server.js b/examples/postMultipartFormData/server.js new file mode 100644 index 0000000..b1be6b3 --- /dev/null +++ b/examples/postMultipartFormData/server.js @@ -0,0 +1,13 @@ +module.exports = function (req, res) { + + req.on('data', function (chunk) { + }); + + req.on('end', function () { + console.log('POST received'); + res.writeHead(200, { + 'Content-Type': 'text/json' + }); + res.end(); + }); +};