我正在使用 Phiehose PHP Twitter Streaming API 并进行了一些修改,以便它也可以与 OAuth 一起使用。
但是,当我访问 Twitter Streaming API 时,我得到一个“Transfer-Encoding: Chunked”标题作为答案,这是通过管道传递的:
Content-Type: application/jsonTransfer-Encoding: chunkedServer: Jetty(6.1.25)
DC8
3522
{long tweet message in JSON format - skipped here as it is not really part of the problem }
Phihose Streaming Client 使用裸 PHP 流连接到 Twitter API。但是,它似乎不理解或不支持分块的 HTTP 答案。
我现在的问题是:应该如何处理?您如何解析或使用分块的 HTTP 响应?