AJAX发送带Header的请求

<script>
    $.ajax({
        type: "GET",
        headers: {
            Accept: "application/json; charset=utf-8",
            Token: "XXXX"
        },
        withCredentials: true,
        url: "http://localhost:23557/api/GetValues",
        data: {"tel":"13714390531"},
        contentType: "application/json",
        dataType: "json",
        success: function (data) {
            alert(data);
        },
        error: function (data) {
 
        }
    });
</script>

 

posted @ 2020-04-14 17:05  zhangzhiping35  阅读(1901)  评论(0编辑  收藏  举报