sdave76
New member
- Joined
- Apr 5, 2024
- Messages
- 1
- Programming Experience
- 10+
I have this strange issue that I cannot seem to resolve:
.Net 4.7.2
Basic aspx and aspx.cs file with some html, css and script (using master file)
I have a simple method that does a jquery ajax call to a REST API endpoint
For some reason when I try and call an endpoint in Azure it fails with "0 error NetworkError: A network error occurred." Any other public REST end point with same response type works fine. Both URLs work fine in Postman and normal browser request
.Net 4.7.2
Basic aspx and aspx.cs file with some html, css and script (using master file)
I have a simple method that does a jquery ajax call to a REST API endpoint
For some reason when I try and call an endpoint in Azure it fails with "0 error NetworkError: A network error occurred." Any other public REST end point with same response type works fine. Both URLs work fine in Postman and normal browser request
JavaScript:
// This one does not work
function LoadSomething(vehicle) {
$.ajax({
type: "GET",
url: "https://xxxxxxxxx.azurewebsites.net/api/vehicle/getvehicle",
async: false,
success: function (output) {
alert(output);
},
error: function (jQXHR, textStatus, errorThrown) {
alert(jQXHR.status + " " + textStatus + " " + errorThrown);
}
});
// This one works 100%
function LoadVehicle(vehicle) {
$.ajax({
type: "GET",
url: "https://api.restful-api.dev/objects?id=3&id=5&id=10",
async: false,
success: function (output) {
alert(output[0].name);
},
error: function (jQXHR, textStatus, errorThrown) {
alert(jQXHR.status + " " + textStatus + " " + errorThrown);
}
});
Last edited by a moderator: