Last active
August 29, 2015 14:02
-
-
Save syads321/361552809582c0531d19 to your computer and use it in GitHub Desktop.
Csrf Token Using Ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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