public function process()
    {
        if ($this->isCapturing()) {
            $this->stopCapture();
        }
        $this->setBatchRequest(true);
        $data       = '';
        $batchParts = $this->getBatchParts();

        if (count($batchParts) === 0) {
            throw new ClientException('Can\'t process empty batch.');
        }

        $combinedDataHeader = '--' . HttpHelper::MIME_BOUNDARY . HttpHelper::EOL;
        $combinedDataHeader .= 'Content-Type: application/x-arango-batchpart' . HttpHelper::EOL;

        /** @var $partValue BatchPart */
        foreach ($batchParts as $partValue) {
            if (null !== $partValue) {

                $data .= $combinedDataHeader;
                if (null !== $partValueId = $partValue->getId()) {
                    $data .= 'Content-Id: ' . (string) $partValueId . HttpHelper::SEPARATOR;
                } else {
                    $data .= HttpHelper::EOL;
                }

                $data .= (string) $partValue->getRequest() . HttpHelper::EOL;
            }
        }

        $data .= '--' . HttpHelper::MIME_BOUNDARY . '--' . HttpHelper::SEPARATOR;

        $params               = [];
        $url                  = UrlHelper::appendParamsUrl(Urls::URL_BATCH, $params);
        $this->_batchResponse = $this->_connection->post($url, $data);

        if ($this->_batchResponse->getHttpCode() !== 200) {
            return $this->_batchResponse;
        }

        $body       = $this->_batchResponse->getBody();
        $body       = trim($body, '--' . HttpHelper::MIME_BOUNDARY . '--');
        $batchParts = $this->splitWithContentIdKey('--' . HttpHelper::MIME_BOUNDARY . HttpHelper::EOL, $body);

        foreach ($batchParts as $partKey => $partValue) {
            $response                     = new HttpResponse($partValue);
            $body                         = $response->getBody();
            $response                     = new HttpResponse($body);
            $batchPartResponses[$partKey] = $response;
            $this->getPart($partKey)->setResponse($batchPartResponses[$partKey]);
        }

        return $this;
    }