aiohttp server跳转链接问题
在用aiohttp编写server的时候,在用户登录这块需要跳转到单点登录页面,而这个链接是外部程序怎么办?下面记录下跳转程序:
站内跳转:
def redirect(router, route_name):location = router[route_name].url_for()
return web.HTTPFound(location)
redirect(request.app.router, 'index')
站外跳转(跳转百度)
from aiohttp import webreturn web.Response(
headers={
'Location': 'http://www.baidu.com'
},
status=303
)
以上是 aiohttp server跳转链接问题 的全部内容, 来源链接: www.h5w3.com/116098.html