获取请求参数
web.input
获取请求头
web.ctx.env
请求处理方式
请求头获取
return web.ctx.env 获取请求中解析的信息 包括端口 域名
import web urls = ( '/index','index', '/blog/\d+','blog', '/(.*)','hello', ) app = web.application(urls, globals()) class index: def GET(self): query = web.input() return query class blog: def POST(self): data = web.input() return data def GET(self): return web.ctx.env class hello: def GET(self, name): return open(r'login.html').read() if __name__ == "__main__": app.run() #http://localhost:8080/index?name=python&age=18&city=shenzhen #http://localhost:8080/ #http://localhost:8080/blog/123?name=python