From d532a6b181c048850fbc47d76e6d9eca5928f14f Mon Sep 17 00:00:00 2001 From: Mike <7198316+notmike101@users.noreply.github.com> Date: Mon, 13 Dec 2021 22:23:49 -0800 Subject: [PATCH] Remove Unnecessary JSON.stringify Axios "automagically" stringfies the post body, there's no need to pre-stringify. Pre-stringifying can result in unexpected behavior when you're passing in JSON content that includes quotes, such as `{ name: "My name is \"Mike\"" }` --- index.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/index.mjs b/index.mjs index e42f229..9ae1673 100644 --- a/index.mjs +++ b/index.mjs @@ -232,7 +232,6 @@ export default class WooCommerceRestApi { if (data) { options.headers["Content-Type"] = "application/json;charset=utf-8"; - options.data = JSON.stringify(data); } // Allow set and override Axios options.