While the documentation states that the Headers class matches the documentation provided by MDN, the class actually misses the forEach method.
This is not breaking, as one can easily polyfill the method, but this should be fixed, as some packages may use this method, which would result in errors.
Iām not sure what youāre asking - we already supported FormData before this week. If it helps, this is a snippet from the test case:
let fd = new FormData();
fd.forEach(function(v, k, t) {
assert(false); // should not be called on empty form
});
let foreachOutput = [];
fd.append("key1", "value1");
fd.append("key2", "value2");
fd.forEach(function(value, key, captureFd) {
foreachOutput.push(`${key}=${value}`);
});
console.assert("" + foreachOutput.join('&'), "key1=value1&key2=value2");
This is coming very soonā¦ in fact itās technically already there but weāre missing Wrangler-side support to opt into it. (We couldnāt just change the API for everyone because it could break people.) Should be ready in the next couple weeks.
There is, but I probably shouldnāt give out the info before I get a chance to test it myself, since we might have to change it if there are issues. Iāll let you know when weāre ready for people to use itā¦
Sorry for the delay, there were indeed a few bugs I had to work through. But I just posted a Wrangler PR which adds support:
If you are using the upload API directly without Wrangler, the compatibility_date and compatibility_flags fields just go directly into the JSON metadata blob (the first āpartā of the multipart/form-data upload bundle).
URL is the canonical example of something we want to fix with this approach. But itās a bit more work as we actually have to write a compliant implementation.