python redirect函数怎么用?

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。

描述:

跳转指定的url

语法:

redirect();

参数:

path

实例使用:

fromflaskimportredirect
defredirect(path):
header='HTTP/1.1302JUMP\r\nContent-Type:text/html\r\n'
location='Location:{}'.format(path)
response=header+location
returnresponse.encode('utf-8')

《相关推荐:php框架》

发表回复