I am not sure what the issue is but I can’t get angular’s $http.post function to work:
.controller('channelCtrl', function($http) {
var requestData = {
"post":"/api/v1/post/" + postSlug + "/",
"like_status": ture
}
$http.post("http://website.com/api/v1/postlike/", requestData, {
headers: { 'Content-Type': 'application/json'}
}).success(function(responseData) {
console.log(responseData)
}).error(function(err) {
console.log(err)
})
}
It WORKS in my browser but does not work on my device.
p.s. console.log does not return anything. It seems like the function doesnt get called at all