You are viewing our Forum Archives. To view or take place in current topics click here.
Is this how you get the token of a URL?
Posted:
Is this how you get the token of a URL?Posted:
Status: Offline
Joined: Jul 03, 201113Year Member
Posts: 978
Reputation Power: 38
Status: Offline
Joined: Jul 03, 201113Year Member
Posts: 978
Reputation Power: 38
$.ajax({
url:link,
type:'POST',
headers:{"X-CSRF-TOKEN": TokenRegex },
success:function a (data){
$.get(url).success(data)
var TokenRegex = data.match(/XsrfToken\.setToken\('(.+)'\);/);
}
})
link is already defined, just didnt paste all the code and its somewhere a few lines up :p
But basically i need to get the token of said URL, not sure if i'm doing this right.
Thats why im asking :^)
url:link,
type:'POST',
headers:{"X-CSRF-TOKEN": TokenRegex },
success:function a (data){
$.get(url).success(data)
var TokenRegex = data.match(/XsrfToken\.setToken\('(.+)'\);/);
}
})
link is already defined, just didnt paste all the code and its somewhere a few lines up :p
But basically i need to get the token of said URL, not sure if i'm doing this right.
Thats why im asking :^)
#2. Posted:
Status: Offline
Joined: Dec 30, 201310Year Member
Posts: 1,331
Reputation Power: 69
You are viewing our Forum Archives. To view or take place in current topics click here.