9、测试【Ajax】的Post请求
HTML编码:
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <script> $(document).ready(function () { $.ajax({ url: "http://localhost:5833/api/Test/GetPostInfo", type: "Post", dataType: "json", success: function (data) { document.write(data["code"]); document.write("<hr/>"); document.write(data["message"]); document.write("<hr/>"); document.write(data["result"]); } }); }); </script>
效果:
第四章【四、ASP.NET Web API应用程序与跨域操作】完结。
【一、控制器与视图:https://laoshifu.blog.csdn.net/article/details/120126288】
【二、数据传递:https://laoshifu.blog.csdn.net/article/details/120127320】
【三、表单与文件上传:https://laoshifu.blog.csdn.net/article/details/120130566】
【四、ASP.NET Web API应用程序与跨域操作:https://laoshifu.blog.csdn.net/article/details/120160728】
【五、HttpClient接口解析:https://laoshifu.blog.csdn.net/article/details/120332379】