I have the csrf which it's already attached to the axios header at bootstap.js, I get always this response from server when try to post simple post (they are three pictures below explaining my situation)
Asked
Active
Viewed 1,160 times
0
-
Hello, please provide the actual code instead of screenshots. Thank you. – Philip Feldmann Oct 22 '17 at 10:27
-
Did u add `csrf_field` correctly? Also, list yours headers – GONG Oct 22 '17 at 11:35
-
I can't replicate this given what you have posted. – craig_h Oct 22 '17 at 11:42
-
@GONG Yes i did it correctly – K.33s Oct 23 '17 at 16:48
-
Can you also show how you handle the error? The default response isn't json I believe. – plmrlnsnts Dec 04 '17 at 14:45
1 Answers
3
Try this, it works for me so far but you'll be without CSRF, go to 'App\Http\Middleware\VerifyCsrfToken' then edit the protected variable to this
protected $except = [
"/*"
];
the '/*'
says to exclude CSRF from all routes, although this isn't ideal it should fix the problem, Maybe just exclude those specific routes that are throwing you the error?
e.g. "/specificRoute"

Kenziiee Flavius
- 1,918
- 4
- 25
- 57