Minu is an HTML-fragment loader. JSON is supported for attribute configuration, not as a request body or response format. This page shows both sides clearly.
minu-vals and minu-headers are JSON objects. Minu parses
them before the request; nested values are stringified into form fields.
The echoed values appear here.
A response with Content-Type: application/json is still treated as
text. Minu swaps the raw JSON string into the target; it does not render fields.
Raw body appears here.
When the endpoint is JSON-only, use native fetch and render the HTML
yourself. Minu is not involved in this request.
Parsed items appear here.
| Thing | Supported? | Notes |
|---|---|---|
minu-vals JSON object | ✅ | Merged into request values. |
minu-headers JSON object | ✅ | Merged into request headers. |
| JSON request body | ❌ | Bodies are form-urlencoded or multipart. |
| JSON response rendering | ❌ | Responses are HTML fragments. |
| Server-side JSON → HTML | ✅ | Render the fragment, then let Minu swap it. |
Client-side fetch() + JSON | ✅ | Use your own renderer; bypass Minu. |
response.text(); there is no JSON parser in the runtime.fetch and your own renderer).// works: JSON config in attributes
<button minu-post="/save"
minu-vals='{"source":"demo","nested":{"level":2}}'
minu-headers='{"X-Demo-Token":"abc"}'>
Save
</button>
// does not work: JSON body / JSON response
// Minu sends form fields and expects an HTML fragment.
If Minu needs to consume a JSON API directly, add a server-side adapter or ask for a separate JSON mode — it is intentionally not part of the core build.