I've got an example app: https://github.com/LateralThoughts/orsyp-frontend-training/tree/master/zupr_trackr. It exposes 3 JPA entities (Company, Employee, Activity) via REST resources handled by Spring DATA/REST.
Although I can successfully query the REST API through a browser REST add-on for instance, the following query (on the same domain or another one) always returns a 404:
$.getJSON("http://localhost:8080/api/companies/")
.success(function() { alert("success"); })
.fail(function(event, jqxhr, exception) {
console.log(jqxhr, exception);
})
.complete(function() { alert("Done"); }
);
The only difference we noticed while comparing a generated HTTP request (via a REST add-on) and a jquery-driven one is the absence of 'Referer' in the first case and its presence in the last.
Adding this header with the REST add-on interface will cause the request to fail as described earlier.
Any ideas are welcome, thanks in advance
Rolf
P.S.: this is true for GET/POST and other verbs.