Skip to main content
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

Known issue: that body: form does not send multipart data — fetch coerces the FormData with String(), so the server receives the literal text "[object Object]". Build the payload as an explicit string (JSON, urlencoded, or a hand-built multipart body with a content-type header) until form/binary bodies are serialized natively.

Blob reference

There is no blob.stream(). Read with text() / arrayBuffer() / bytes().
Known issue: a Blob body is stringified to "[object Object]", not sent as bytes — and no content-type is inferred. Send the text yourself:

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:
One wrinkle: the handler receives 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:
Binary parts may not survive the handler’s string round-trip — prefer base64 text for binary uploads.

Practical example: file drop endpoint

Accept a payload as a Blob, 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.