Get the response body as string
string
public function getBody() {
// Decode the body if it was transfer-encoded
switch (strtolower($this
->getHeader('transfer-encoding'))) {
// Handle chunked body
case 'chunked':
return self::decodeChunkedBody($this->body);
break;
// No transfer encoding, or unknown encoding extension:
// return body as is
default:
return $this->body;
break;
}
}