gpt4 book ai didi

javascript - promise 解决哪些状态码

转载 作者:行者123 更新时间:2023-11-30 12:40:09 26 4
gpt4 key购买 nike

我想澄清来自 $http 的 promise 针对哪些 http 状态代码已解决,哪些已被拒绝。据我了解,它仅在 200 的情况下解决,其余的都被拒绝。

是吗?还是有其他情况?

最佳答案

编辑:

对于 AngularJS

A response status code between 200 and 299 is considered a success status and will result in the success callback being called. Any response status code outside of that range is considered an error status and will result in the error callback being called.

来源:https://github.com/angular/angular.js/blob/master/src/ng/http.js

关于javascript - promise 解决哪些状态码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24775724/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com