Extends
lithium\net\http\Message
Initialize the Response
Returns
voidSource
protected function _init() {
parent::_init();
if ($this->_config['message']) {
$this->body = $this->_parseMessage($this->_config['message']);
}
if (isset($this->headers['Transfer-Encoding'])) {
$this->body = $this->_httpChunkedDecode($this->body);
}
if (isset($this->headers['Content-Type'])) {
$pattern = '/([-\w\/+]+)(;\s*?charset=(.+))?/i';
preg_match($pattern, $this->headers['Content-Type'], $match);
if (isset($match[1])) {
$this->type = trim($match[1]);
$this->body = $this->_decode($this->body);
}
if (isset($match[3])) {
$this->encoding = strtoupper(trim($match[3]));
}
}
}