首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用Actionscript解码分块HTTP

使用Actionscript解码分块HTTP
EN

Stack Overflow用户
提问于 2008-11-13 19:14:09
回答 1查看 1.9K关注 0票数 0

我已经成功地通过套接字连接到了带有ActionScript 3的超文本传输协议服务器。唯一的问题是,服务器正在发送分块的HTTP。有没有其他语言中的泛型函数,我可以看一下,它清楚地展示了如何解码分块?我很确定没有ActionScript库可以做到这一点。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2008-11-14 10:21:17

HTTP 1.1 specification (或来自W3C)提供了一个伪代码示例,说明如何decode chunked transfer-coding

代码语言:javascript
运行
复制
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
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/287920

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档