This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Feature request: provide HTTP status to the success callback of $resource #8341
Closed
Description
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").