I'm trying to send a json via $ http.get, but it is returning error in console "500 (Internal Server Error)" system.technology.ws/pedited.store.asp:1 Is this error in the ASP system or in the $ http request? Follow the request code
$http({
method: 'GET',
url: 'http://sistema.tecnologia.ws/pedidoGravar.asp',
data: JSON.stringify($scope.recuperaSeuPedido),
headers: {'Content-Type': 'application/json'}
}).then(function successCallback(response) {
console.log(response.data)
console.log("enviou");
}, function errorCallback(response) {
console.log(response.data)
console.log("nao enviou");
});
I disabled the $ http and did it in pure js and returns the same error. Follow the code below
xhr = new XMLHttpRequest();
var url = "http://sistema.tecnologia.ws/pedidoGravar.asp";
xhr.open("GET", url, true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
console.log(xhr.responseText);
}
console.log(xhr.responseText);
}
xhr.send("json=" + encodeURIComponent(JSON.stringify($scope.recuperaSeuPedido)));