zf2 decodeGzip, ¿por qué está protegido?
Frecuentes
Visto 564 veces
1
I'm getting back what appears to be gzipped data in a call to a zf2 api. The content-type is gzip, and the content body looks encoded. So I tried this:
$decoded = $response->decodeGzip($response->getContent());
and I got back this error:
Call to protected method Zend\Http\Response::decodeGzip()
Why is it protected? It seems like decoding gzipped data would be a handy thing to be able to do.
1 Respuestas
6
Deberías usar $response->getBody()
. getBody()
El método comprueba el Content-Encoding
header and if this is gzip, it will extract the body from the Gzipped content.
You can check this method in the online repository: Zend\Http\Response
Respondido 20 Jul 14, 13:07
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas zend-framework2 gzip or haz tu propia pregunta.