I am using Node and I am getting an error trying to upload to Cloudflare images. This was working about a week ago but suddenly broke. I am using the "https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/images/v1"
endpoint and it works via cURL but I am getting a ERROR 5400: Bad request: Error parsing form fields
error when I try to execute the same function through node.
The post call looks like:
await fetch(https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/images/v1, {
method: 'POST',
headers: {
'Content-Type': `multipart/form-data`,
Authorization: `Bearer ${api key}`,
},
body: formdata,
});
The formdata is super simple and I only have
formdata.append(
'file',
fs.createReadStream(path_to_file),
);
After I make this request, I get ERROR 5400: Bad request: Error parsing form fields