You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
When a $resource request fails, you get the response object passed to the error callback, and you can retrieve that HTTP status from that. When the request succeeds, however, the success callback is given only the payload and the headers.
It's often important to be able to distinguish between different success cases using the HTTP response code. It's not uncommon to have POST requests that either create and return a new resource (HTTP 201) or find and return an existing one that will fill the present need (HTTP 200). Or, say, the difference between a 201 ("your resource was created, and here it is") vs. a 202 ("we'll try to create this resource; check back later").