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.

有帮助吗?

解决方案

Try it:

import request, route, run

@route('/user-agent')
def user_agent():
    return request.environ.get('HTTP_USER_AGENT')
run()
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top