在 Python 中检索浏览器标头
我目前正在画一个空白,如何在 Python Tornado 中获取用户的当前浏览器标头信息?例如,在 PHP 中,您可以简单地查看 $_SERVER 数据。龙卷风的替代方案是什么?
注意:如何获取客户端IP龙卷风请求?并且“请求”对我不起作用。
I'm currently drawing a blank as how to get the current browser header information for a user in Python Tornado? For example, in PHP you'd simple view the $_SERVER data. What is Tornado's alternative?
Note: How do I get the client IP of a Tornado request? and the "request" does not work for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是基于我拥有的服务器的片段,我们在其中从请求中检索一些标头数据:
Here's a snippet based off of a server I have where we retrieve some header data from the request:
您可以使用类似于
tornado/httpserver.py
的逻辑,或者仅使用xheaders=True
创建tornado.httpserver.HTTPServer()
。You can use logic similar to
tornado/httpserver.py
or just createtornado.httpserver.HTTPServer()
withxheaders=True
.