mercredi 28 novembre 2018

Unable to make POST request using FETCH

I am trying to make a POST request using FETCH but I am getting this error - 419 (unknown status)

This is my code:

fetch(url, {
    method: "post", headers: {'Content-Type': 'application/json'}, mode: 'no-cors',
   body: {
       _token: '{!! csrf_token() !!}',
   }
   }).then(function(response) {
       return response.json();
   })

I have also added <meta name="csrf-token" content=""> in the head section.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire