Get $_SERVER['HTTP_USER_AGENT'] variable value in Bottle

别来无恙 提交于 2019-12-13 14:50:40

问题


I am new to python bottle framework and need to get $_SERVER['HTTP_USER_AGENT'] variable value specially. Pleas can some one explain how can I achieve this.


回答1:


Try it:

import request, route, run

@route('/user-agent')
def user_agent():
    return request.environ.get('HTTP_USER_AGENT')
run()


来源:https://stackoverflow.com/questions/9400166/get-serverhttp-user-agent-variable-value-in-bottle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!