mercredi 2 septembre 2020

Ajax error 0 status: error on ajax call to mvc core web api

I am getting an ajax error code: 0 error status: "error".

The API tests successfully when testing with Postman. Getting the above error when running my ajax script:

The script is below:

$(document).ready(function () { $.ajax({ url: "https://localhost:44326/api/LoadInkQueue", type: 'post', contentType: "application/json", data: JSON.stringify(data), success: function (response) { $.each(response, function (i, item) { $("#files").append("

  • " + item + "
  • ") }); }, error: function (xhr, status, error) { var errorMessage = xhr.status + ': ' + xhr.statusText; alert('Error:: ' + errorMessage); }, failure: function (response) { alert(response); }, }); });


    Aucun commentaire:

    Enregistrer un commentaire