Amp\Artax\AggregateBody::getBody PHP Method

getBody() public method

The resolved promise value may be a string or an Iterator. An event reactor is always passed to assist with asynchronous value resolution.
public getBody ( ) : Amp\Promise
return Amp\Promise
    public function getBody();

Usage Example

Example #1
0
 private function processAggregateBody(RequestCycle $cycle, AggregateBody $body)
 {
     $promise = $body->getBody($this->reactor);
     $promise->when(function ($error, $result) use($cycle, $body) {
         if ($error) {
             $this->fail($cycle, $error);
         } else {
             $cycle->request->setBody($result);
             $this->processAggregateBodyHeaders($cycle, $body);
         }
     });
 }