I have a problem with a PUT call in AngularJS.
When making the call to the API at the press of a button, it makes a first request, but then performs a second one, with the same parameters, which generates me in error in the response.
API call
$http.put("http://192.168.20.14:8089/api/v1/ContratoPotencial/?Contratacion_ContratosPotencialesAPIDTO={\"IdEmpresa\": 2,\"IdUsuario\": 1}")
.then(function successCallback (response) {
console.log("Insertado! ");
console.log(response);
}, function errorCallback(response) {
console.log("HAY ERROR");
});
In both cases to enter the success, the problem is that the first call inserts the user and of course, when the second is made, it returns the error that this user already exists.
CONSOLE ERROR
In Chrome console I see the following
As you can see, there is a call where the source is the main.min.js, but the strange thing is that a call comes from an "other" source that I do not launch and it is the one that is spoiling my communication.