在ajax post请求中包含__RequestVerificationToken

时间:2018-06-07 06:11:00

标签: javascript ajax post xmlhttprequest

我有这个ajax请求:      var http = new XMLHttpRequest();      var url ='https://www.test.dk/api/basket';

var params = {"name": "Test"};
http.open('POST', url, true);

http.setRequestHeader('Content-type', 'application/json');

http.onreadystatechange = function() {
    if(http.readyState == 4 && http.status == 200) {
        alert(http.responseText);
    }
}

http.send(JSON.stringify(params));

是否可以在请求中包含请求验证cookie(__ RequestVerificationToken)?

0 个答案:

没有答案