code: def _fetch_json(self, url, payload):
          
          params = {
              'data': json.dumps(payload),
              'headers': {'content-type': 'application/json'},
              'params': {'sid': self.sma_sid} if self.sma_sid else None,
          }
          for _ in range(3):
              try:
                  with async_timeout.timeout(3):
                      res = yield from self._aio_session.post(
                          self._url + url, **params)
                      return (yield from res.json()) or {}
              except asyncio.TimeoutError:
                  continue
          return {'err': "Could not connect to SMA at {} (timeout)"
                         .format(self._url)}
docs: Fetch json data for requests.