打印所有的头信息
for k, v in web.ctx.env.items():
print(k,v)
获取某条头信息
ct = web.ctx.env.get('CONTENT_TYPE')
import web
urls = (
'/', 'index',
)
app = web.application(urls, globals())
render = web.template.render('templates/')
class index:
def GET(self):
return ('name')
def POST(self):
i = web.data()
for k, v in web.ctx.env.items():
print(k,v)
ct = web.ctx.env.get('fdsfdsf')
b = str(i, encoding="utf-8")
print(b,ct)
return b
if __name__ == "__main__":
app.run()
网友评论