Bluz\Response\Response::getHeaders PHP 메소드

getHeaders() 공개 메소드

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
리턴 array returns an associative array of the message's headers.
    public function getHeaders()
    {
        return $this->headers;
    }

Usage 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);
 }