0

ソケット経由で ActionScript 3 を使用して HTTP サーバーに正常に接続しました。唯一の問題は、サーバーがチャンクされた HTTP を送信していることです。チャンクをデコードする方法を明確に示す、他の言語に汎用関数はありますか? このための ActionScript ライブラリが存在しないことは確かです。

4

1 に答える 1

4

HTTP 1.1仕様(またはW3Cから)は、チャンク転送コーディングをデコードする方法の擬似コードの例を提供します。

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
于 2008-11-14T10:21:16.527 に答える