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

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -