Reputation: 4859
I have designed a python tornado project to capture news and republish them. I want to show news to users and when a user is clicked on a link, he/she will be redirected to main news agency web site. I can't use simple to redirect user to main news because I want to get some statistics from the user and the show the news.
for example there are some news from BBC in my web site. The user click on one of them and I want to increase view counter of that news in my database and then show the news.
Currently I refer the user to a link in my website and then redirect to main news agency using this command:
self.redirect("http://bbc.co.uk/a_news_link")
In this case is the user received the link directly from BBC or the page is received by my application and then is sent to the user?
Upvotes: 0
Views: 708
Reputation: 24007
"self.redirect" sends the user an HTTP Redirect. The user's browser receives a response from Tornado with status code 302 and the "bbc" URL. The browser then navigates to the bbc URL.
http://en.wikipedia.org/wiki/URL_redirection#HTTP_status_codes_3xx
Upvotes: 1