$(document).ready(function() { public function prueba(){ $.ajax({ url:'https://179.40.38.10:7117/api/v1/auth/login', type:'get', datatype:'json', data:{ }, }).done(function(response) { console.log(response) }) .fail(function (jqXHR, textStatus, errorThrown) { alert("" + jqXHR + textStatus +errorThrown); }); } })