You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const postData = {
wpUnicodeCheck: "β³π²β₯πππΎπΈβ΄πΉβ―",
wpAntispam: null,
wikieditorUsed: "yes"
};
var formData = new FormData();
for ( var key in postData ) {
formData.append(key, postData[key]);
}
console.log(formData)
let response = await fetch('https://enahwvayvwxi.x.pipedream.net/', {
method: "POST",
body: formData
});
and it converts automatically the data to multipart/form-data.
But when I use node-fetch-cookies the remote server gets content-type text/plain and and the body become [object FormData].
Is there anyway to achieve this or this is not supported at this moment?
The text was updated successfully, but these errors were encountered:
node-fetch-cookies is based on the v2.x releases of node-fetch, and the native FormData() is only supported by the v3.x releases, as it is only supported by Node.js since version 18.
If you want to send forms, there are two possibilities I'm aware of:
application/x-www-form-urlencoded: This is supported by node-fetch v2 using a native Node.js class:
In node-fetch, we can POST data like this
and it converts automatically the data to multipart/form-data.
But when I use node-fetch-cookies the remote server gets content-type text/plain and and the body become [object FormData].
Is there anyway to achieve this or this is not supported at this moment?
The text was updated successfully, but these errors were encountered: