/** * Decode the body * * @return void */ public function decodeBody() { if (isset($this->headers['Transfer-Encoding']) && $this->headers['Transfer-Encoding'] == 'chunked') { $this->body = Response::decodeChunkedBody($this->body); } $this->body = Response::decodeBody($this->body, $this->headers['Content-Encoding']); }
public function testEncodeAndDecode() { $e = Response::encodeBody('This is a test.'); $this->assertEquals('This is a test.', Response::decodeBody($e)); $e = Response::encodeBody('This is a test.', 'deflate'); $this->assertEquals('This is a test.', Response::decodeBody($e, 'deflate')); }