Skip to content

Instantly share code, notes, and snippets.

@0xjmp
Created February 16, 2015 21:28
Show Gist options
  • Save 0xjmp/8f4b018a517e6526a5a2 to your computer and use it in GitHub Desktop.
Save 0xjmp/8f4b018a517e6526a5a2 to your computer and use it in GitHub Desktop.
angular.module('app', []).config = function($httpProvider) {
var authToken = $("meta[name=\"csrf-token\"]").attr("content");
$httpProvider.defaults.headers.common["X-CSRF-TOKEN"] = authToken;
$httpProvider.defaults.headers.patch = {
'Content-Type': 'application/json;charset=utf-8'
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment