Ergo\Http\Response::getBody PHP Method

getBody() public method

public getBody ( ) : string
return string
    public function getBody()
    {
        return $this->_body;
    }

Usage Example

Example #1
0
 public function testResponseWithBody()
 {
     $headers = array(new Http\HeaderField('Content-Length', 6), new Http\HeaderField('Content-Type', 'text/plain'));
     $response = new Http\Response(200, $headers, 'abcdef');
     $this->assertEquals($response->getStatus()->getCode(), 200);
     $this->assertEquals($response->getHeaders()->value('Content-Length'), 6);
     $this->assertEquals($response->getHeaders()->value('Content-Type'), 'text/plain');
     $this->assertTrue($response->hasBody());
     $this->assertEquals($response->getBody(), 'abcdef');
 }