Zyberg
3 months ago
300
2
Laravel

Why can't the same route have both GET and PUT methods on a linux server?

Posted 3 months ago by Zyberg

Hello!

Today I've stumbled upon an unexpected error: I had two routes named /api/users/me defined in routes/api.php, first GET, then PUT. It all worked alright on my machine (windows 10). However, when I uploaded the code to server, PUT route would throw me "405 Method Not Allowed" exception.

I find this quite perplexing, so could anyone explain?

P.S. Fixed the issue by changing PUT into a POST

Please sign in or create an account to participate in this conversation.