Skip to content

Instantly share code, notes, and snippets.

@paltman
Created July 3, 2015 14:11
Show Gist options
  • Save paltman/490049a64fa4115a2cea to your computer and use it in GitHub Desktop.
Save paltman/490049a64fa4115a2cea to your computer and use it in GitHub Desktop.
override axios default csrf header and cookie name to match what Django expects
var axios = require("axios");
var axiosDefaults = require("axios/lib/defaults");
axiosDefaults.xsrfCookieName = "csrftoken"
axiosDefaults.xsrfHeaderName = "X-CSRFToken"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment