Actually, the question is in the cap. Is it possible to get the server response code using aiohttp, if so, how, and does it use much more resources than the same with Requests? Thanks in advance for your reply.
1 answer
session.get(url) returns a Response class object from which you can get the response code :
resp = await client_session.get(url) async with resp: print(resp.status) |
rs = requests.head('https://ya.ru/')print(rs.status_code)- gil9red