您发布的内容存在语法错误,但没有区别,因为您无法通过传递HTTP标头
$.post()。
如果您使用的是jQuery版本> =
1.5,请切换至(docs)选项
$.ajax()并通过。(如果您使用的是旧版的jQuery,我将向您展示如何通过该选项进行操作。)
headers
beforeSend
$.ajax({ url: 'https://url.com', type: 'post', data: { access_token: 'XXXXXXXXXXXXXXXXXXX' }, headers: { Header_Name_One: 'Header Value One', //If your header name has spaces or any other char not appropriate "Header Name Two": 'Header Value Two' //for object property name, use quoted notation shown in second }, dataType: 'json', success: function (data) { console.info(data); }});


