Amp\Artax\AggregateBody::getHeaders PHP Method

getHeaders() public method

The resolved promise value must be a key-value array mapping header fields to values. An event reactor is always passed to assist with asynchronous value resolution.
public getHeaders ( ) : Amp\Promise
return Amp\Promise
    public function getHeaders();

Usage Example

Esempio n. 1
0
 private function processAggregateBodyHeaders(RequestCycle $cycle, AggregateBody $body)
 {
     $promise = $body->getHeaders();
     $promise->when(function ($error, $result) use($cycle, $body) {
         if ($error) {
             $this->fail($cycle, $error);
         } else {
             $cycle->request->setAllHeaders($result);
             $this->finalizeRequest($cycle);
         }
     });
 }