redirects are always GET so maybe your analysis is flawed ?
405 Method Not Allowed
Just wanted to share something I ran into with a 405 Method Not Allowed issue, since I couldn't find my specific instance discussed anywhere else. Most cases I could find used Forms and had CSRF token, or Method Field issues. This instance doesn't use a form - just an Axios call to a Laravel route.
I have an item in a list that I'd like to mark as completed. To do this, I'm using Axios to send a patch request to an endpoint I set up in my web routes file (PATCH route to /todos/{todo}). In my controller's update method, I'm updating a completed_at field, and then redirecting to another page.
The issue here is that I was trying to redirect from within the PATCH context, which prompted the 405 Method Not Allowed error. In Chrome Dev Tools I could see that my redirect was still using the PATCH method. Because I don't have a PATCH route for the redirect location, I got the 405 error.
The solution for me was to let Axios handle the redirect and remove that portion from my update method.
When I can't find an issue I have on the internet, that typically means I'm doing something wrong. I'm guessing that's the case here, but for someone that's just play with things, these kinds of silly hurdles can put a halt to any learning.
I'm sure there is a better explanation for this, so if anyone has a better take on it feel free to drop it here.
Please or to participate in this conversation.