You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using hx-post I see in the console a POST request to the value, quickly followed by a GET request to the value, the result of which is returned. Is it possible to handle errors that are returned in the POST response? All I see in the console is a 302 Found status and an empty body, even though my controller is returning a 200 with a body. Any insights into how this works would be much appreciated.
The text was updated successfully, but these errors were encountered:
If your server is returning an error code, htmx will trigger the responseError event (https://htmx.org/events/#responseError.htmx). But it sounds like that isn't what's happening here.
You can turn on logging in htmx to see everything that's going on: https://htmx.org/docs/#events. It can be a little overwhelming, but maybe that will illuminate things more.
Thanks @rschroll and @chg20, after further investivation it seems the server was returning a 302 status after all. Fixing the controller to return a 200 status code solved it. The responseError event looks perfect for future use, cheers!
When using
hx-post
I see in the console a POST request to the value, quickly followed by a GET request to the value, the result of which is returned. Is it possible to handle errors that are returned in the POST response? All I see in the console is a302 Found
status and an empty body, even though my controller is returning a200
with a body. Any insights into how this works would be much appreciated.The text was updated successfully, but these errors were encountered: