code: async def get_json(self, url, timeout=30, astext=False, exceptions=False):
          
          try:
              with async_timeout.timeout(timeout):
                  res = await self._aio_session.get(url)
                  if res.status != 200:
                      _LOGGER.error("QSUSB returned %s [%s]", res.status, url)
                      return None
                  res_text = await res.text()
          except (aiohttp.client_exceptions.ClientError,
                  asyncio.TimeoutError) as exc:
              if exceptions:
                  raise exc
              return None
  
          if astext:
              return res_text
  
          try:
              return json.loads(res_text)
          except json.decoder.JSONDecodeError:
              if res_text.strip(" ") == "":
                  return None
              _LOGGER.error("Could not decode %s [%s]", res_text, url)
docs: Get URL and parse JSON from text.