mardi 26 avril 2016

Cant access api rest mvc from server, yes in local host

I am doing an api rest with mvc, when I test it in localhost go well, I can call this api from code behing, or from js but when I upload the api to my hosting (myasp.net) without data connections, I can´t access it the by js, but yes from code behind. I have some js samples codes to access to a web api (Jquery and Ajax)...what I am doing bad?? Sample js works good: $.getJSON('http://localhost:22166/api/Persona') .done(function (data) {

                });
            });

or ajax: $.ajax({ url: "......localhost... api/Persona",

}).done(function(data) {

}); Sample js doesnot work: $.getJSON('http://ift.tt/1VzTI94') .done(function (data) {

                });
            });

PD: I´ve tried on Fiddler the two urls and all works

Thanks!!!




Aucun commentaire:

Enregistrer un commentaire