I would like to specify dataType: 'json'
as in conventional jQuery $.ajax
.
Is this possible with Angular.js $http.post
?
You can use the HTTP Config object to set the headers:
$http({
method: 'POST',
url: 'somewhere.xyz',
headers: {
'Content-type': 'application/json'
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With