JSON and presets

Send JSON to this site’s demo echo endpoint; replace the base URL with your API in an application.

import { Http, envelope } from "fetchzen";
const api = Http.create(`${location.origin}/api/examples/`, {
cache: false, secure: false, preset: envelope,
});
const result = await api.post("echo/", JSON.stringify({ name: "Ada" }));
console.log(result.payload);
Try this requestJSON echo / presets
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.

envelope unwraps data; bare and problem preserve the JSON body. Try GET and POST. The bounded demo echoes only string name and message fields. secure: false is for these public demos, not a recommendation for authenticated APIs.

Next: validation or presets.