【发布时间】:2015-04-08 01:38:13
【问题描述】:
这是我得到的错误
Argument 1 passed to GuzzleHttp\Client::send() must implement interface GuzzleHttp\Message\RequestInterface, array given,
这是我正在使用的代码
$guzzleResponses = $client->send(array(
$client->get('http://www.sitepoint.com/'),
$client->get('http://www.sitepoint.com/'),
$client->get('http://www.sitepoint.com/')
));
foreach($guzzleResponses as $guzzleResponse) {
$goutteObject = new Symfony\Component\BrowserKit\Response(
$guzzleResponse->getBody(true),
$guzzleResponse->getStatusCode(),
$guzzleResponse->getHeaders()
);
}
我理解这个错误意味着当它期望其他东西时我正在传递一个数组。但是我想同时处理多个请求,想不出别的办法?
【问题讨论】: