最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
angularjs $http调用接口的教程
时间:2022-06-25 15:49:13 编辑:袖梨 来源:一聚教程网
如下所示:
$http.get("/merchantmall/merchant.json") .success(function(data, status, headers, config) { console.log(arguments); }) .error(function(data, status, headers, config) { console.log(arguments); })
$http({url: "/merchantmall/merchant.json", }) .success(function(data, status, headers, config) { console.log(arguments); }) .error(function(data, status, headers, config) { console.log(arguments); })
var promise = $http({ method: 'GET', url: '/api/users.json' }); promise.then(function(resp) { // resp是一个响应对象 }, function(resp) { // 带有错误信息的resp });
var promise = $http({ method: 'GET', url: '/api/users.json' }); promise.success(function(data, status, headers, config) { // 处理成功的响应 }); promise.error(function(data, status, headers, config) { // 处理非成功的响应 });
相关文章
- UU Wallet 推出零门槛 VISA 铂金卡,全球通付即刻开启 08-02
- 哈利波特魔法觉醒密室开启怎么打?密室开启满星卡组攻略 08-02
- 新盗墓笔记投资基金值得买吗?新盗墓笔记投资基金收益情况介绍 08-02
- 2025年数字货币交易平台推荐 十大虚拟币交易app排名 08-02
- 《蜀门手游》快速升级攻略2025 08-02
- 新盗墓笔记月卡值得买吗?新盗墓笔记月卡购买收益效果介绍 08-02