如何在aiohttp服务器处理程序中使用HTTP重定向返回响应?
解决方法:
文档:http://aiohttp.readthedocs.io/en/stable/web_quickstart.html#redirects
async def handler(request):
raise web.HTTPFound('/redirect')
异常类及其对应的HTTP状态代码:http://aiohttp.readthedocs.io/en/stable/web_quickstart.html#exceptions
* 300 - HTTPMultipleChoices
* 301 - HTTPMovedPermanently
* 302 - HTTPFound
* 303 - HTTPSeeOther
* 304 - HTTPNotModified
* 305 - HTTPUseProxy
* 307 - HTTPTemporaryRedirect
* 308 - HTTPPermanentRedirect