本文介绍了解码HTTP分块用的Actionscript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经成功连接到一个HTTP服务器使用ActionScript 3以上的插座。唯一的问题是,服务器正在发送分块HTTP。是否有一个通用的功能,在任何其他语言,我可以看一下,明确说明了如何去code中的分块?我是pretty的确定没有ActionScript库围绕这一点。
I have successfully connected to an HTTP server with ActionScript 3 over sockets. The only problem is, the server is sending chunked HTTP. Is there a generic function in any other language I can look at that clearly shows how to decode the chunking? I'm pretty sure there are no ActionScript libraries around for this.
推荐答案
在 HTTP 1.1规范(或从 W3C )提供了一个伪code如何德code分块传输编码:
The HTTP 1.1 specification (or from W3C) provides a pseudocode example of how to 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
这篇关于解码HTTP分块用的Actionscript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!