- $http = $this->_curlFactory->create();
- $config = ['timeout' => 60, 'verifypeer' => $this->_config->getValue('verifyPeer')];
- if ($this->getUseProxy()) {
- $config['proxy'] = $this->getProxyHost() . ':' . $this->getProxyPort();
- }
- if ($this->getUseCertAuthentication()) {
- $config['ssl_cert'] = $this->getApiCertificate();
- }
- $http->setConfig($config);
- $http->write(
- \Zend_Http_Client::POST,
- $this->getApiEndpoint(),
- '1.1',
- $this->_headers,
- $this->_buildQuery($request)
- );
- $response = $http->read();