ой да ладно, что вы напали на человека? либа и либа Спустя 138 сек.
Mars, как это
public function sendHttpRequest($requestXml)
{
$curl = curl_init();
//set the server we are using (could be Sandbox or Production server)
curl_setopt($curl, CURLOPT_URL, $this->apiParams['server_url']);
// stop CURL from verifying the peer's certificate
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
// set the headers using the array of headers
$this->logData['request_headers'] = $headers = $this->buildEbayHeaders();
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, 1);
// set the XML body of the request
$this->logData['request'] = $requestXml;
curl_setopt($curl, CURLOPT_POSTFIELDS, $requestXml);
// set it to return the transfer as a string from curl_exec
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$responseXml = curl_exec($curl);
$this->logData['response'] = $responseXml;
curl_close($curl);
return $responseXml;
}
будет выглядеть с твоей либой?
наверное как-то так
public function sendHttpRequest($requestXml)
{
$this->logData['request_headers'] = $headers = $this->buildEbayHeaders();
$this->logData['request'] = $requestXml;
$this->logData['response'] = $curl->ipoint(
array('url' => $this->apiParams['server_url'],
'ssl_verifypeer' => 0,
'ssl_verifyhost' => 0,
'httpheader' => $headers,
'post' => 1,
'postfields' => $requestXml))->exec();
return $this->logData['response'];
}
Спустя 271 сек.
ещё вариант
public function sendHttpRequest($requestXml)
{
$this->logData['request_headers'] = $headers = $this->buildEbayHeaders();
$this->logData['request'] = $requestXml;
$curl->upoint($this->apiParams['server_url']);
$curl->and->ssl_verifypeer = $curl->and->ssl_verifyhost = 0;
$curl->and->httpheader = $this->logData['request_headers'] = $this->buildEbayHeaders();
$curl->and->post = 1;
$curl->and->postfields = $requestXml;
$this->logData['response'] = $curl();
return $this->logData['response'];
}
Спустя 207 сек.
ой я наркоман блеать
вот нормальный вариант
public function sendHttpRequest($requestXml)
{
$curl->upoint($this->apiParams['server_url']);
$curl->and->ssl_verifypeer = $curl->and->ssl_verifyhost = 0;
$curl->and->httpheader = $this->logData['request_headers'] = $this->buildEbayHeaders();
$curl->and->post = 1;
$curl->and->postfields = $this->logData['request'] = $requestXml;
return $this->logData['response'] = $curl();
}
Спустя 50 сек.
а так красивее
public function sendHttpRequest($requestXml)
{
$curl->upoint($this->apiParams['server_url']);
$curl->and->ssl_verifypeer = $curl->and->ssl_verifyhost = 0;
$curl->and->httpheader = $this->logData['request_headers'] = $this->buildEbayHeaders();
$curl->and->post = 1; $curl->and->postfields = $this->logData['request'] = $requestXml;
return $this->logData['response'] = $curl();
}
Спустя 254 сек.
А у дуда нету этого
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
он мухлюет
а еще его курл не умеет CURLCLOSEPOLICY_