superagent-rails-csrf
v0.0.2
Published
Set CSRF Token as X-CSRF-Token header to superagent requests.
Downloads
20,907
Readme
superagent-rails-csrf
Set CSRF Token as X-CSRF-Token
header to superagent requests.
CSRF Token is created by Rails, and get token from meta tag (generated by csrf_meta_tags
helper).
Usage
var request = require('superagent');
require('superagent-rails-csrf')(request);
request
.post('/blogs/1/like')
.setCsrfToken()
.end(function (err, res) {
...
});