UPDATED: As of angularjs 1.5, promise methods success and error have been deprecated. (see this answer)
from current docs:
$http.get('/someUrl', config).then(successCallback, errorCallback);
$http.post('/someUrl', data, config).then(successCallback, errorCallback);
you can use the function's other arguments like so:
error(function(data, status, headers, config) {
console.log(data);
console.log(status);
}
see $http docs:
// Simple GET request example :
$http.get('/someUrl').
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
}).
error(function(data, status, headers, config) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});