Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response Targets extension should be mentioned in the homepage #2043

Closed
Sleepful opened this issue Nov 26, 2023 · 1 comment
Closed

Response Targets extension should be mentioned in the homepage #2043

Sleepful opened this issue Nov 26, 2023 · 1 comment

Comments

@Sleepful
Copy link
Contributor

This one:

https://htmx.org/extensions/response-targets/

Why?

Input validation is The most important thing on a web-app. For example, if a login attempt fails, 401 Unathorized should be the right status code. Returning something like 200 for a failed login attempt is dubious. Like-wise, 422 is a more appropriate response to an invalid form submission than 200. Additionally, following HTMX philosophy, it makes sense to include the error message in the body of the request as HyperMedia.

But HTMX with its current defaults requires a 200 in order to allow swapping.

@Telroshan
Copy link
Collaborator

Closing this issue as your PR related to the issue has been merged.

Also note that merging this extension into htmx's core is being discussed for htmx 2 to have native errors handling support 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants