ajax发送头信息
更新:HHH   时间:2023-1-7


$.ajax({
    url: "http://localhost:1005/api/values",
    type: "GET",
    beforeSend: function (xhr) {
        xhr.setRequestHeader("X-Custom-Header1", "Bar");
    },
    success: function (data) {
        alert(data);
    },
    error: function (xhr, textStatus, errorThrow) {
        alert(xhr.readyState);
    }
});


返回开发技术教程...