0
votes

Quick question:

Angular $http returns a promise. The promise can be a success, resolved object (status 200) or an error, reject object (status 404). Does that mean that anything that is not a status 200 response IN angular $http will be rejected and sent to the error part of the promise? Example: 404,304,401, 500, etc.

2

2 Answers

1
votes

Yes by default. However, you can change that behaviour using interceptors, where you can choose what kind of promise execution to return, and that will modify the pipe to be executed in the original call.

More info about interceptors

3
votes

Anything that begins with a 2xx is a successful response:

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes