dongyin8991 2013-08-12 15:12
浏览 264
已采纳

HTTP传输编码分块解码PHP

I have this HTTP response content :

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Mon, 12 Aug 2013 15:08:10 GMT
PK�Ctemps_attente.json���n� �߅9�Bw���VU��Uߠs���^��#�CGç��ͷ�r7G�3Hnp����^pYSu\@Qo%~x��FGa�Y�ا����S���-ua���t��j-���s�%э��+,g�xq.��������t�fb� �0:)�:�K�}^�N�L����>�֌щ%#�̲x`C@��m݃ :^��$~�i8���WzCh�a�ă���7t�O|��AX˂��UO$���<��y"�;�'F��]��{֘Ha}F��<��l6��o벰V���66t�&��f�Ť��x�H��툗���/PKA�Y�1�PK�CA�Y�1�temps_attente.jsonPK@q

I would like to know what format is the response and how to decompile to have the final response.

I tried to use this function: http_chunked_decode but I did not succeed.

  • 写回答

1条回答 默认 最新

  • dtlab08822 2013-08-12 16:16
    关注

    The body (or at least what appears to be the body) of the response is not chunked.

    It does appear to be compressed - with HTTP this should be expressly stated in the headers,

    There is no blank line between the what appears to be the headers and what appears to be the body.

    If this is really the response you are getting it's not HTTP - an off-the-shelf function is not going to make sense of it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大