Fix fetcher's send_json to make post a request and get a response.

This commit is contained in:
2023-06-16 19:59:51 +03:00
parent 29eeaccc30
commit 52863dcd1c
+4 -4
View File
@@ -30,8 +30,8 @@ class ApiFetcher:
"""
url = f"{self.__base_url}{endpoint}"
async with self.__session.get(url) as session:
await session.post(url, json=context)
json_data = await session.json()
return (session.status, json_data)
async with self.__session as session:
async with session.post(url, json=context) as response:
json_data = await response.json()
return (response.status, json_data)