I am using ajax call to send google sign in information to my backend. But the POST ajax request status is showing as 302 and then it gets converted to GET. I found many solutions for this but nothing worked for me.
function onSignIn(googleUser) {
var profileObject = {}
var profile = googleUser.getBasicProfile();
var csrfmiddlewaretoken =
profileObject['name'] = profile.getName();
profileObject['email'] = profile.getEmail();
profileObject['csrftoken'] = getCookie('csrftoken');
$.ajax({
method: "post",
url: '/login/',
data: JSON.stringify(profileObject),
contentType: "application/json;charset=utf-8",
success: function (response) {
}
});
};
I am using python django framework.