Advertisement
Guest User

Untitled

a guest
Sep 9th, 2021
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <input id="user_id" value="2" name="user_id" type="hidden">
  2.  
  3.  
  4.  
  5. function guardarToken(token){
  6. var formData=new FormData();
  7. formData.append('token',token);
  8. formData.append('user_id', user_id);
  9.  
  10. var config = {
  11. headers: {
  12. 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"').content
  13.  
  14. }
  15. }
  16.  
  17. axios.post('/token',formData, config).then( respuesta=>{
  18. console.log(respuesta);
  19. }).catch( e=>{
  20. console.log(e);
  21. });
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement