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
Post a Comment