From 46e1981d0ff2c6aec794fe3425d031495bc00931 Mon Sep 17 00:00:00 2001 From: Anchal Singh <128113546+imanchalsingh@users.noreply.github.com> Date: Thu, 23 Oct 2025 18:40:03 +0530 Subject: [PATCH] refactor: form data handling in index.html (#7170) * Refactor form data handling in index.html * Update examples/postMultipartFormData/index.html Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update examples/postMultipartFormData/index.html Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Jay Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- examples/postMultipartFormData/index.html | 97 +++++++++++------------ 1 file changed, 47 insertions(+), 50 deletions(-) diff --git a/examples/postMultipartFormData/index.html b/examples/postMultipartFormData/index.html index 6abce1d..a5c27fa 100644 --- a/examples/postMultipartFormData/index.html +++ b/examples/postMultipartFormData/index.html @@ -70,62 +70,59 @@ + axios({ + url: '/postMultipartFormData/server', + data: data, + method: "post", + headers: passAsFormData ? { "Content-Type": "multipart/form-data" } : {}, + }) + .then(res => { + errorOutput.innerHTML = "Successfully posted!"; + }) + .catch(err => { + console.error("Error posting data:", err); + errorOutput.innerHTML = `${err.message}`; + }); + }; +})(); +