November 2017
Intermediate to advanced
542 pages
14h 24m
English
As an alternative to jQuery, we recommend using the rest.js module of cujoJS. The rest.js module provides advanced support for working with HTTP requests and responses in RESTful ways. A core capability is the ability to contextualize the HTTP client, adding behavior as needed by chaining interceptors onto the client, as follows:
var client = rest.chain(csrf, { token: $("meta[name='_csrf']").attr("content"), name: $("meta[name='_csrf_header']").attr("content") });
The configured client can be shared with any component of the application that needs to make a request to the CSRF protected resource. One significant difference between rest.js and jQuery is that the only requests made with the configured client ...
Read now
Unlock full access