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' } })
2.1m questions
2.1m answers
60 comments
57.0k users