What the API actually said
A real API explains why it refused. <name>_error used to read Error: HTTP 422 no matter what came back. It is now the body's own error or message string, and the whole parsed body lands in <name>_error_body, so a page can render per-field errors without a line of its own JavaScript.
A refusal, rendered
/api/echo only accepts POST, so a plain :fetch gets a 405 whose JSON body carries an error string.
Asking the endpoint…
The endpoint said:
And the whole body is available too: ok came back as .
Field-level errors
/api/upload answers a fileless POST with a 422 whose body carries both a sentence and a per-field map:
{ "error": "Pick a file first.", "fields": { "photo": "No file was attached." } }
A page renders each half where it belongs:
:if signup_error
{ signup_error }
:endif
{ signup_error_body.fields.email }
The upload demo has this wired up end to end.
The rules
<name>_errorprefers the body'serrorfield, then itsmessagefield, and falls back toHTTP <status>when the body has neither or is not JSON at all.<name>_error_bodyis the parsed JSON body, ornullwhen the response was not JSON.- Both keys are auto-declared by
:fetchand by a round-trip:form, and both are cleared on the next success.