bigskysoftware / bigskysoftware/htmx
Issue with htmx redirection behavior when using PUT method
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
I'm currently facing an issue with htmx when using the PUT method in combination with redirection. Here's the scenario:
I have a form in my Laravel application that I'm submitting using htmx with the PUT method.
After submitting the form, if there are validation errors, Laravel redirects back to the form page with the errors.
Problem:
The issue arises when Laravel redirects back with the errors. Instead of making a GET request to the form page, htmx seems to make another PUT request to the form URL. This causes a "Method Not Allowed" error because the form URL only accepts GET requests.
I've also tested the behavior with the GET method, and everything works as expected. When submitting the form with the GET method and encountering validation errors, htmx correctly makes a GET request to the form page upon redirection.
My code is as simple as this
```
(render errors if any)
```
Thanks.
Contributor guide
Assessment
This issue has not been assessed yet.