Walkthrough
Everything interesting here happens in the network panel — open it first, then:
- Watch what the client sends. Submit, click the
submitrequest, and open its payload. Alongside the form values sitcsrf: demo-token— a hidden field round-tripped byte for byte — andtoken: tok_123, injected by a pre-submit hook and found in no markup anywhere. Select two colors first andcolorsarrives as an array; the compound name arrives as two fields. What the server receives is not just the fields on the screen. - Watch what the server answers. The same request's response is the protocol's envelope:
{"formsanity": 2, "status": "accepted", "message": "Thanks!"}. The green banner is the client rendering it. - Watch a rejection round-trip. Follow the invalid link above, submit again, and the request goes red with a 422. Its response carries an
errorsarray naming the email field — and the page has rendered that exact error as a bubble on the email field. A server-side verdict finding its way back to the right control is the protocol's other half. Press Tab to leave the field and the bubble stays, with Submit closed: the engine cannot check the server's judgment again. Edit the email and the error clears for the next submission. - An error with no field to edit. Follow the expired link and submit. The server's error names the hidden
csrffield. The person cannot edit that field, so the message appears as a line in the status region, and Submit stays open for another try. - The other two scenarios. redirect: the accepted envelope carries a redirect and the client follows it. error: a 500, and the status region takes its failure state instead of pretending.
- A handler in place of the request. Follow the handler link and submit: no
submitrequest appears, because a submit handler in the page answers in its place. It refuses the prefilledexample.comaddress with aninvalidenvelope, and the bubble lands on Email as a server's would. Change the address and submit again for itsacceptedenvelope. The uniqueness check on Email still goes to the server: a handler takes the place of the submission request only. - The unique sub-protocol, no submit needed. Put
taken@example.comin Email and press Tab: auniquerequest fires and the field flags "already in use". Do it three times fast and the third request is a 429 — the mock rate-limits on purpose, and the client backs off silently rather than flag a field it could not check.