const obj = {hello: 'world'};
const blob = new Blob([JSON.stringify(obj, null, 2)], {type : 'application/json'});
const file = new File([blob], "foo.txt", {
type: "text/plain",
});
const formData = new FormData();
formData.append("foo-file", file, "foo.txt");
const reqsponse = await fetch("https://developer.mozilla.org/", {
method: "POST",
body: formData,
});