I would like to specify dataType: 'json' as in conventional jQuery $.ajax. Is this possible with Angular.js $http.post ?
dataType: 'json'
$.ajax
$http.post
You can use the HTTP Config object to set the headers:
$http({ method: 'POST', url: 'somewhere.xyz', headers: { 'Content-type': 'application/json' } })
1.4m articles
1.4m replys
5 comments
57.0k users