Skip to content

Instantly share code, notes, and snippets.

@syads321
Last active August 29, 2015 14:02
Show Gist options
  • Save syads321/361552809582c0531d19 to your computer and use it in GitHub Desktop.
Save syads321/361552809582c0531d19 to your computer and use it in GitHub Desktop.
Csrf Token Using Ajax
http://www.keltdockins.com/blog/laravel-4-csrf-token-and-ajax-using-jquery
Angular way :
`$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.
The defaults can also be set at runtime via the $http.defaults object in the same fashion. For example:
module.run(function($http) {
$http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'
});
In addition, you can supply a headers property in the config object passed when calling $http(config), which overrides the defaults without changing them globally.
https://docs.angularjs.org/api/ng/service/$http
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment