Skip to content

Instantly share code, notes, and snippets.

@wallin
Created July 22, 2013 06:28
Show Gist options
  • Save wallin/6051689 to your computer and use it in GitHub Desktop.
Save wallin/6051689 to your computer and use it in GitHub Desktop.
Configure HTTP headers in Angular JS
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