Protecting a RESTful JSON API from a CSRF attack