Bluz\Response\Response::getHeaders PHP Method

getHeaders() public method

The keys represent the header name as it will be sent over the wire, and each value is an array of strings associated with the header. Represent the headers as a string foreach ($message->getHeaders() as $name => $values) { echo $name . ": " . implode(", ", $values); }
public getHeaders ( ) : array
return array returns an associative array of the message's headers.
    public function getHeaders()
    {
        return $this->headers;
    }

Usage Example

Example #1
0
 /**
  * @covers \Bluz\Response\Response::setHeaders
  * @covers \Bluz\Response\Response::addHeaders
  * @covers \Bluz\Response\Response::getHeaders
  */
 public function testAddHeaders()
 {
     $this->response->setHeaders(['foo' => ['bar']]);
     $this->response->addHeaders(['foo' => ['baz'], 'baz' => ['qux']]);
     $this->assertEquals(2, sizeof($this->response->getHeaders()));
     $this->assertArrayHasKeyAndSize($this->response->getHeaders(), 'foo', 2);
 }