大型API调用的角度http请求在阶段挂起"小心:请求尚未完成"它挂起了浏览器

时间:2017-02-17 20:37:27

标签: javascript angularjs api google-chrome http

我正在请求一个API,它返回文件的差异。这个数据的内容有时很大(大约900KB的数据)。 当我在chrome浏览器中单独请求此API时,它可以正常工作并在几秒钟内返回数据: https://example.com/1234/file.diff

但是当我使用Angular http方法调用相同的API时,它会挂起"小心:请求尚未完成"状态(从chrome的网络选项卡看)。并且浏览器变得没有响应。

myService.getFileDiff("https://example.com/1234/file.diff").
 then(function (response) {
  $scope.fileDiff = response;
  }, function(error){
   console.log("Some error occured." +error);
});

enter image description here

任何人都可以为此提出解决方案。

0 个答案:

没有答案
相关问题