I am using Jquery for the above requirement.
$.ajax({
type: 'GET',
url: 'https://--------------/rest/auth/1/session'',
crossDomain: true,
dataType: 'jsonp',
success: function (response) {
alert('success--' + response);
},
error: function (response) {
alert('oopss!!');
}
});
I am able to see the response in debugger in JSON format but i have to use dateType: jsonp due to cross domain request, else it throws error 415: Unsupported MediaType
So I get the following errors when i run the script:
SyntaxError: invalid label in Mozilla.
Uncaught SyntaxError: Unexpected token : in Chrome
Please help.
Where am i going wrong.?
Thanks in advance.