我需要向API发送大约500个CURL请求,所以我选择了Zebra_CURL以减少执行时间,但这并没有改善任何内容:
$curl = new Zebra_cURL();
$curl->threads = 30;
$curl->option(array(
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HEADER => FALSE,
CURLOPT_POST => TRUE,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json','Authorization: Basic '. base64_encode("XX:YY")
),
));
for ($i=0; $i < count($recipients); $i++){
$curl->post(array(
'API_URL' => 'To=XXXXX&From=YYYY&Body=ZZZZ'
));
}
我错过了什么吗?或者我应该只做一个$curl->post
?
感谢您的帮助!