1
我有這個代碼發送請求到維基百科API(如記錄here),但是當我看在Chromium中的網絡標籤頭Api-User-Agent
不發送,爲什麼?自定義標題不發送使用ajax
$.ajax({
url: "https://en.wikipedia.org/w/api.php?",
data: {
action: 'query',
prop:'revisions',
rvprop: 'content',
format:'json',
titles: 'Hacker_culture'
},
headers: {
'Api-User-Agent': 'Example Agent'
},
dataType: 'jsonp',
success: function(data) {
}
});