I feel that other answers, while correct, don’t quite explain the root of the question: REST
is a subset of HTTP
. This means everything that can be done via REST
can be done via HTTP
but not everything that can be done via HTTP
can be done via REST
. That is why $resource
uses $http
internally.
So, when to use each other?
If all you need is REST
, that is, you are trying to access a RESTful
webservice, $resource
is going to make it super easy to interact with that webservice.
If instead, you’re trying to access ANYTHING that is not a RESTful
webservice, you’re going to have to go with $http
. Keep in mind, you could also access a RESTful
webservice via $http
, it will just be much more cumbersome than with $resource
. This is the way most people have been doing it outside AngularJS, by using jQuery.ajax
(equivalent of Angular’s $http
).