How to send csrf_token() inside AngularJS form using Laravel API?

后端 未结 5 996
面向向阳花
面向向阳花 2020-11-28 07:16

I am trying to build an angular + laravel rest application. I can get the views of my database. When I try to add new items. I get 500 error telling me mismatch

5条回答
  •  时光取名叫无心
    2020-11-28 07:43

    If you use Laravel 5, no need to add CSRF token to Angular http headers.

    Laravel 5 with Angular do this automatically for you.

    http://laravel.com/docs/5.1/routing#csrf-x-xsrf-token

提交回复
热议问题