code: def _send_batch(self, batch):
          
          try:
              json_batch = '[' + ','.join(batch) + ']'  # Make JSON array string
              logger.debug(consts.LOG_MSG_SENDING_BATCH, len(batch),
                           len(json_batch), self._rest_url)
              res = self._session.post(self._rest_url, data=json_batch,
                                       headers=consts.CONTENT_TYPE_JSON)
              logger.debug(consts.LOG_MSG_BATCH_SENT_RESULT, res.status_code,
                           res.content)
              if res.status_code == 400:
                  self._notify(logging.CRITICAL, consts.LOG_MSG_BAD_TOKEN)
                  raise exceptions.BadToken(consts.LOG_MSG_BAD_TOKEN)
              elif not res.ok:
                  raise exceptions.SendFailed("Got bad response code - %s: %s" % (
                      res.status_code, res.content if res.content else 'No info'))
          except broken_pipe_errors as ex:
              self._is_connected.clear()
              raise exceptions.BatchTooBig(consts.LOG_MSG_BATCH_TOO_BIG % str(ex))
          except requests.exceptions.RequestException as ex:
              raise exceptions.SendFailed(str(ex))
docs: Sends a batch to the destination server via HTTP REST API