yii\httpclient\Client::batchSend PHP 메소드

batchSend() 공개 메소드

This method accepts an array of the Request objects and returns an array of the Response objects. Keys of the response array correspond the ones from request array. php $client = new Client(); $requests = [ 'news' => $client->get('http://domain.com/news'), 'friends' => $client->get('http://domain.com/user/friends', ['userId' => 12]), ]; $responses = $client->batchSend($requests); var_dump($responses['news']->isOk); var_dump($responses['friends']->isOk);
public batchSend ( array $requests ) : Response[]
$requests array requests to perform.
리턴 Response[] responses list.
    public function batchSend(array $requests)
    {
        return $this->getTransport()->batchSend($requests);
    }