I am sending an http request from Angular to a PHP server and he replies this:
{
"data": null,
"status": -1,
"config": {
"method": "POST",
"transformRequest": [
null
],
"transformResponse": [
null
],
"data": {},
"url": "http://api.elpozon.com/rest/login",
"headers": {
"Accept": "application/json",
"Content-Type": "application/json;charset=utf-8"
}
},
"statusText": ""
}
When I do it from POSTMAN, it returns the login information.
This is the function in Angular that executes the request.
$scope.intentoDeLoginPozon = function(){
var datapost = {
method: 'POST',
data: {
user : $scope.username,
pass: $scope.password
},
url: 'http://api.elpozon.com/rest/login',
headers:{
'Accept': 'application/json'
}
};
$http(datapost).then(function successCallback(response){
$scope.mensaje = response;
}, function errorCallback(response){
$scope.error = response;
});
}
I do not have any information on how the PHP Server is programmed.
What explanation exists for this?