AI OnAI Off
Nevermind, digging deeper it seemed it was just a matter of mismatching parameters (the actual store was not quite as simple as the sample code). Not supplying a required method parameter produced this somewhat misleading exception. Doh!
I've created a REST store like this:
I can get the store just fine in a Dojo widget, and when doing store.get() I get the correct result. It also works when doing a GET request through Postman.
However, when doing a POST or PUT, I get the anti-forgery validation error saying "This request has probably been tampered with. Close the browser and try again."
The stack trace says the requests fails at EPiServer.Shell.Services.Rest.RestHttpHandler.ValidateAntiForgeryToken(HttpContextBase httpContext).
Any bright ideas? :)