@@ -39,7 +39,8 @@ def __init__(self, loop=None, session=None):
3939
4040 async def _initialize_session (self ):
4141 headers = {
42- 'User-Agent ' : "Tibia.py/%s (+https://github.com/Galarzaa90/tibia.py" % tibiapy .__version__
42+ 'User-Agent' : "Tibia.py/%s (+https://github.com/Galarzaa90/tibia.py" % tibiapy .__version__ ,
43+ 'Accept-Encoding' : "deflate, gzip"
4344 }
4445 self .session = aiohttp .ClientSession (loop = self .loop , headers = headers ) # type: aiohttp.ClientSession
4546
@@ -75,7 +76,7 @@ async def _get(self, url):
7576 If there's any connection errors during the request.
7677 """
7778 try :
78- async with self .session .get (url ) as resp :
79+ async with self .session .get (url , compress = True ) as resp :
7980 self ._handle_status (resp .status )
8081 return await resp .text ()
8182 except aiohttp .ClientError as e :
@@ -97,7 +98,7 @@ async def _post(self, url, data):
9798 The text content of the response.
9899 """
99100 try :
100- async with self .session .post (url , data = data ) as resp :
101+ async with self .session .post (url , data = data , compress = True ) as resp :
101102 self ._handle_status (resp .status )
102103 return await resp .text ()
103104 except aiohttp .ClientError as e :
0 commit comments