send ajax to tornado server for redirection and get 200 status code. client side
$.ajax({
type: "POST",
url: url,
processData: false,
contentType: 'application/json',
data: data,
complete: function (xmlHttp, textStatus) {
alert(xmlHttp.status.toString());
alert(textStatus);
if (xmlHttp.status.toString()[0] == '3') {
top.location.href = xmlHttp.getResponseHeader('Location');
alert(top.location.href)
}
}
});
server side
class Login(tornado.web.RequestHandler):
def post(self):
print "post"
print self.request.body
self.redirect("/")
on chrome browser F12 network tag
login post 302 ...
10.xxx.xxx.xxx get 304 ...
why the alert function display 200 status code? Thanks