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.

  • 2
    Example of receiving the answer: github.com/aio-libs/aiohttp#client - gil9red
  • God bless you. Always you help out: D - AgeofCreations
  • @ gil9red Ah, damn it. This I saw and did. It returns the html code. I wrote the wrong question, I can already see. I need a server response code. - AgeofCreations
  • one
    For requests: rs = requests.head('https://ya.ru/') print(rs.status_code) - gil9red

1 answer 1

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)