M
M
metroyanno2016-04-25 06:19:00
Laravel
metroyanno, 2016-04-25 06:19:00

How to make a POST request with CSRF_TOKEN?

I will immediately write that I did not find the answer in Google.
I have a problem with sending a POST request to a Laravel page:
TokenMismatchException in VerifyCsrfToken.php line 53
As I have already read, you need to include this CSRF TOKEN in the POST request, BUT HOW?!
PS Without AJAX

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
metroyanno, 2016-05-31
@metroyanno

Some versions of Laravel do not accept POST requests with CSRF_TOKEN, they must be changed to GET requests

A
Artem, 2016-04-25
@tweaker3

You need to put in your form:

<input type="hidden" name="_token" value="{{ csrf_token() }}">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question