aiohttp
aiohttp copied to clipboard
Force gzip compression in aiohttp web.StreamResponse
I use the following code to serve file download requests:
resp = web.StreamResponse(headers={
'Server': 'Nginx',
'Content-Type': 'text/html',
'Content-Disposition': 'attrachment; filename=' + filename
})
await resp.prepare(request)
How do I force gzip compression? The relevant document is missing on aiohttp's website.
You can find relevant docs here