I'm trying to post a request using FormData(), I need to include the "content type" header so I'm using the blob to append entries to my form, but this automatically sets the filename to "blob"
const formData = new FormData();
const obj1 = new Blob([json_data], {type: 'text/plain; encoding=utf-8'});
formData.append("small_config", obj1);
const obj2 = new Blob([client], {type: 'text/plain; encoding=utf-8'});
formData.append("app_type", obj2);
const obj3 = new Blob([version], {type: 'text/plain; encoding=utf-8'});
formData.append("product_version", obj3);
let thumb = await fetch(my_url, {
method: 'POST',
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
redirect: 'follow',
referrerPolicy: 'no-referrer',
body: formData
});
Is there a way to both set the content type and not include filename?