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:04  zhangzhiping35  阅读(4)  评论(0)    收藏  举报