插件铬我使用jQuery,使跨起源Ajax请求,我想在像this--请求设置头,但它说,它是一个不正确的请求:CORS在阿贾克斯
$.ajax({
url: address,
headers:{
'Access-Control-Allow-Origin': '*'
}
success: function(result) {
pipelineCallback(result, guid_key, j, missing_program);
},
error: function(result) {
console.log(result);
},
async: true
});
警告:当我没有设置标题并使用这个CORS chrome插件时,跨域请求可以正常运行......这个问题有什么问题?
插件链接(那里有一个公共GitHub库太): https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en
如果有效,为什么要添加标头呢? –
您需要将服务器设置为使用标题。 –
服务器确实使用标题 - 我说我不想使用插件在请求上设置标题。我想根据请求手动设置标题。 – KonradS