ajax

$.ajax({

type:'POST',

url:'',

data: JSON.stringify(data),

dataType:'json',

beforeSend:function(xhr) {

xhr.setRequestHeader("Content-Type","application/json");//此处设置header参数键值对

},

xhrFields: {

withCredentials:true

},

cache:false,

})

你可能感兴趣的:(ajax)