1. 首页
  2. 数据库
  3. 其它
  4. angularJS 发起$http.post和$http.get请求的实现方法

angularJS 发起$http.post和$http.get请求的实现方法

上传者: 2020-12-23 01:28:55上传 PDF文件 33.3KB 热度 23次
AngularJS发起$http.post请求 代码如下: $http({ method:'post', url:'post.php', data:{name:"aaa",id:1,age:20} }).success(function(req){ console.log(req); }) 这时候你会发现收不到返回的数据,结果为null,这是因为要转换成form data。 解决方案: 配置$httpProvider: var myApp = angular.module('app',[]); myApp.config(function($httpProvider
下载地址
用户评论