0

How I can convert this ajax call to angular httpClient call. I am getting Cors error

$.ajax({
                            type: "GET",
                            url: reportAccessUrl+"/hi-ee/j_spring_security_logout",
                            xhrFields: { withCredentials: true },
                            crossDomain: true,
                            dataType: 'jsonp',
                            success: function(data) 
                            {
                                console.log("Logout successfully");
                            }, 
                            error: function(data)
                            {
                                console.log("Logout Error");
                            }
                        }); 
ysk
  • 159
  • 1
  • 3
  • 12
  • `crossDomain: true` is nonsense. It's used to suppress stuff jQuery does for same origin requests so they can work if you redirect to a different URL that is cross-origin. It has no effect on this request at all. – Quentin Sep 23 '22 at 13:04

0 Answers0