I'm calling one API from HTML/Javascript page using RestViewer.I'm able to get response on RestViewer for that API. However, after generating auto code it is not working in javascript.In browser it is giving error "Request cancelled".Neither of success and failure block getting called. Attached generated code for calling API.Please help if have any idea.
function callAPI() {
rest.get(
'http://rest-service.guides.spring.io/greeting',
null,
null,
function(data, xhr) {
alert(data);
// TODO success callback
},
function(data, xhr) {
alert(data);
// TODO error callback
}
);
}