作为程序员一定要保持良好的睡眠,才能好编程

ajax跨域测试文件 html

发布时间:2020-02-08


这是一个跨域测试文件代码 需要自取


<html lang="en">
<head>
   <meta charset="UTF-8">

 
<script src="http://www.xiaosongit.com/Public/Js/jquery.js"></script>

<script>
 


$.ajax({

    'url':'http://127.0.0.1:8888/custom/inquiry/doctorList',
    'method':'post',
    'headers':{
        'accept':"application/json; charset=utf-8",
        'X-Access-Token':'123456'
    },
    'data':{
        'currentPage':'1',
        'pageSize':'10'
    },
        success:function(data){
        console.log(data);
    }


});

</script>

      <title>Document</title>
</head>
<body>

</body>
</html>



ajax请求laravel的api接口 跨域


跨域访问和防盗链基本原理