我已经成功地通过套接字连接到了带有ActionScript 3的超文本传输协议服务器。唯一的问题是,服务器正在发送分块的HTTP。有没有其他语言中的泛型函数,我可以看一下,它清楚地展示了如何解码分块?我很确定没有ActionScript库可以做到这一点。
发布于 2008-11-14 10:21:17
HTTP 1.1 specification (或来自W3C)提供了一个伪代码示例,说明如何decode chunked transfer-coding:
length := 0
read chunk-size, chunk-extension (if any) and CRLF
while (chunk-size > 0) {
read chunk-data and CRLF
append chunk-data to entity-body
length := length + chunk-size
read chunk-size and CRLF
}
read entity-header
while (entity-header not empty) {
append entity-header to existing header fields
read entity-header
}
Content-Length := length
Remove "chunked" from Transfer-Encoding
https://stackoverflow.com/questions/287920
复制相似问题