예제 #1
0
 public function testMultiPost()
 {
     $responses = $this->guzzle_adapter->multiPost(array(array('url' => 'http://www.ebussola.com', 'data' => array(), 'headers' => array()), array('url' => 'http://posttestserver.com', 'data' => array(), 'headers' => array())));
     $this->assertCount(2, $responses);
     foreach ($responses as $response) {
         $this->assertInstanceOf('\\SimpleXMLElement', $response);
     }
 }
예제 #2
0
 /**
  * @param array $calls
  * An array of Calls
  * Each call is an array with keys: service, parameters and endpoint
  *
  * @return \SimpleXMLElement[]
  */
 public function multiCall(array $calls)
 {
     $requests = array();
     foreach ($calls as $call) {
         $parameters = $this->buildParams($call['service'], $call['parameters'], $call['endpoint']);
         $requests[] = array('url' => $call['endpoint'], 'data' => $parameters, 'headers' => array());
     }
     return $this->http->multiPost($requests);
 }