Blob carries typed binary data; FormData carries multipart-style key/value fields (text or Blobs). Both are globals, and both come back out of res.blob() / res.formData(). Sending is a different story: fetch stringifies non-string bodies (see Known issue below), so only string (and URLSearchParams) payloads reach the wire intact.
Quick look
Blob reference
There is no
blob.stream(). Read with text() / arrayBuffer() / bytes().FormData reference
Round-tripping: res.blob() / res.formData()
Both readers work on Request and Response, and are re-readable like every body reader in Fairyfly:
body as a string, and re-wrapping it in a Request re-parses it. Since fetch also sends strings as-is, build multipart (or urlencoded) payloads as explicit strings with a matching content-type header — FormData objects stringify to "[object Object]" instead:
Practical example: file drop endpoint
Accept a payload as aBlob, store its text, and report back (fs.writeFile writes string data):
Troubleshooting
get("field") returns null — the field name is misspelled (names are exact, case-sensitive) or the request wasn’t multipart/urlencoded at all. Check form.has(name) and form.size() first.
Binary corrupted through the handler — the (url, method, body) handler form stringifies bodies. Keep binary uploads on paths served to real fetch clients, or accept base64 text and decode server-side.
X is not a function on blob.stream() — doesn’t exist. Use text() / arrayBuffer() / bytes().
Server rejects an HTTP/1.1 upload over 1 MB with 413 — HTTP/1.1 requests up to 4 KB (headers + body) use a static buffer, and larger bodies spill to the heap up to 1 MB per request (64 MB process-wide spill cap; HTTP/2 allows up to 10 MB per stream / 16 MB per session). Responses allow bodies up to 10 MB (a 64 KB stage buffer spills to the heap past that). Chunk HTTP/1.1 uploads larger than 1 MB across requests.