Here is one tutorial on POST http://blog.revathskumar.com/2015/07/submit-a-form-with-react.html
Using POST method with ReactJS
I'm incorporating ReactJS with Laravel but a little clueless as to how to use the POST method. Here are extracts of my attempt.
submit(){ fetch('/words', { method: 'POST', headers: { //'Accept' and 'Content-Type', 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'), }, body: JSON.stringify({ property: property information }) }) }
render() { return ( //Input tags here Save ); }
The URL, '/words', lead to the store( ) function, but pressing this Save button (i.e. calling submit( ) function) leads to TokenMismatchException in VerifyCsrfToken.php.
Does anyone have a good idea as to calling POST with ReactJS?
Any advice will be appreciated,
Please or to participate in this conversation.