python - How can I get http referrer in Tornado? -


class headerhandler(tornado.web.requesthandler):     def get(request):         print request.meta.headers["http_referer"] 

the code doesn't work, tell me headerhandler doesn't has attribute of meta. wrong code ?

the attributes of tornado's request object documented @ http://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil.httpserverrequest

headers in self.request.headers, , not have cgi-style http_ prefix:

print(self.request.headers.get("referer")) 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -