Download

Receive a bounded binary response from this site’s demo endpoint.

import { Http, bare } from "fetchzen";
const api = Http.create(`${location.origin}/api/examples/`, {
cache: false, secure: false, preset: bare,
});
const blob = await api.get<Blob, { known: string }>("download", {
params: { known: "1" }, responseType: "blob",
onDownloadProgress: ({ loaded, total, percent }) => {
console.log({ loaded, total, percent });
},
});
console.log(blob.size);
Try this requestDownload / byte progress
Request parameters

Only Run sends a request to this site's demo API. Use synthetic data only; do not send secrets or personal files. Uploads are counted, not stored.

Ready. No request sent.

Result

Choose Run to see the response.
Event log
No events yet.

The demo sends 256 KiB in 16 server chunks; network buffering can merge them. Without a usable total, progress stays indeterminate. Non-identity encoding makes totals unknown; for cross-origin APIs, CORS must expose the relevant length and encoding headers. Choose Save demo.bin after completion; no automatic download starts. The panel reuses one object URL and revokes it on the next Run or when you leave the page.

Next: streaming or file transfers.