I have project in angular js.In that i want to make ajax request to specific url. I have used 2 methods.
$http.post(url, {
params: {
email: $scope.login.username,password:$scope.login.password
}
})
.success(function(data, status, headers, config) {
console.log('Success' + data);
})
.error(function(data, status, headers, config) {
console.log('Error Status : ' + status);
});
and
$http({
url: url,
method: 'POST',
data: loginData
})
.success(function(data, status) {
$scope.errormassage = '';
accessToken = data.token;
})
.error(function(data, status) {
//alert("::status:"+status);
});
both are POST Request but when i see request in console it show request type OPTIONS.
this post request works well in POSTMAN
Chrome plugin.
any help please.