onRequestPost and HTMLRewriter


I would like to use HTMLRewriter after a form submission in order to inject error messages. I find this impossible (or maybe I am just dumb) after testing.

Consider the following:

  • I do not want to create an /api endpoint to send ajax requests
  • I want to handle POST on /register and return modified HTML on the same page

Please advise…