I
I
ildar-meyker2019-11-24 23:34:01
Laravel
ildar-meyker, 2019-11-24 23:34:01

The GET method is not supported for this route. Supported methods: POST?

I have this route:
Route::post('authors/{author}/delete-poster', '[email protected]');
I added it to delete the author's poster (picture).
Then I decided to go through a get request to see what would happen. And I generated a message from the header. So everything is right, there really is no such route. But that's not normal, right? Should I have used a different method or what?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2019-11-24
@ildar-meyker

Everything is logical. The framework works according to such rules, and not as you wanted. I want to make the behavior that you expect - we configure the routing further.

V
Vyacheslav Plisko, 2019-11-25
@AmdY

That's right, the GET method is only for getting data, and POST (PUT, DELETE, etc.) is for changing data. This is important from a security point of view, besides, POST must be backed by a CSRF token.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question