How do I return a response with HTTP redirect in an aiohttp server handler?
Documentation: http://aiohttp.readthedocs.io/en/stable/web_quickstart.html#redirects
async def handler(request):
raise web.HTTPFound('/redirect')
The exception classes and their corresponding HTTP status codes: 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With