0
I am trying to send a json via $http.get, but it is returning an error in the console "500 (Internal Server Error)" system.technology.Ws/pedidGravar.Asp:1 Is this error in ASP system or $http request? Follow the requisition 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 $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)));
I don’t know Angular.js or have the slightest idea what "Ionic" is, but...the method shouldn’t be POST ?
– zentrunix
already tried tbm, but returns the same error
– Alexandre Scrideli
The error is in the *.Asp file or on your server. If you display the request codeGram.Asp will look better to help.Asp.
– Klaider
Your server supports ASP?
– viana
Yes yes...ja corrected the error...vo post the code to help the guys who need tbm
– Alexandre Scrideli