0
我嘗試對eBay API進行GetItemTransactions調用。調用基本上正常工作,但只返回最後一個事務(itemID)。eBay API - 只返回最後一個itemID的cURL_multi
我認爲在我的cURL語法中有一個錯誤,因爲我使用了相同的URL($ url),我將不勝感激。這裏是代碼:
$mh = curl_multi_init();
$handles = array();
$i = 0;
$urls = array("https://api.ebay.com/ws/api.dll",
"https://api.ebay.com/ws/api.dll",
"https://api.ebay.com/ws/api.dll");
foreach ($urls as $url)
{
$handles[$url] = curl_init($url);
curl_setopt($handles[$url], CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($handles[$url], CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($handles[$url], CURLOPT_HTTPHEADER, $headers);
curl_setopt($handles[$url], CURLOPT_POST, 1);
curl_setopt($handles[$url], CURLOPT_POSTFIELDS, $xml_request[$i]);
curl_setopt($handles[$url], CURLOPT_RETURNTRANSFER, true);
curl_multi_add_handle($mh, $handles[$url]);
$i++;
}
$頭(它們是相同的)和$ xml_request變量正確傳輸。我認爲$ handles [$ url]會被覆蓋,因爲它在每個循環中都是一樣的?