In Services File:
var req = {
method: 'POST',
url: 'https://themommyclub.com/apicore/buddypressread/messages_new_message/',
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
'Access-Control-Allow-Headers':'acrHeaders'
},
params: {
subject:"NewMessageFromMobileApp",
content:"fsdafsfsafsafsdfasfds",
sender_id:1,
pw:"TestPassword",
insecure:"cool",
callback:"JSON_CALLBACK",
recipients:1
}
};
return $http(req).then(function(response) {
console.log('Response:', response);
}, function(data, status, headers, config) {
console.log('Error:', data);
});
In FireFox:
But When I Make The Post Request In The postman Extension ,it response successfully