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

main
KKlochko 2 years ago
parent 29eeaccc30
commit 52863dcd1c

@ -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)

Loading…
Cancel
Save