Thursday, February 8, 2018

Laravel 5.5 : 419 unknown status with AJAX - development

Laravel 5.5 : 419 unknown status with AJAX

I am requesting POST :

Route :

Route::post('/register','CommonController@postRegister')->name('register');

CSRF Meta tag :

<meta name="csrf-token" content="">

$("#submitSalonForm").click(function(e) {
  $.ajaxSetup({
      headers: {
          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
      }
  });
  $.ajax({
      url: "/register",
      type: "post",
      data: new FormData($('form')[1]),
      cache: false,
      contentType: false,
      processData: false,
      success:function(response) {
          return alert('Form 2 submitted');
      }
  });
});

And the exception :

Exception screenshot

I have no idea what am i missing here.



from Laravel Questions and Answers https://laravelquestions.com/php/laravel-5-5-419-unknown-status-with-ajax/
via Lzo Media

No comments:

Post a Comment