Created
July 22, 2013 06:28
-
-
Save wallin/6051689 to your computer and use it in GitHub Desktop.
Configure HTTP headers in Angular JS
This file contains hidden or 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
angular.module('myApp').config([ | |
'$httpProvider' | |
($httpProvider) -> | |
# For all request types | |
$httpProvider.defaults.headers.common['Content-Type'] = 'application/json' | |
# For GET only | |
$httpProvider.defaults.headers.get['My-Header']='value'. | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment