Get $_SERVER['HTTP_USER_AGENT'] variable value in Bottle
题
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()
不隶属于 StackOverflow