feat(http): parse and build HTTP/1.1 framing by bytes

This commit is contained in:
Marqdo Agent committed 2026-11-21 11:05:15 +08:00
1 parent 28b178fc70
commit 0d8ed44010
11 files changed
+416 -105

No files matched your search

+9 -1
View File
@@ -11,4 +11,12 @@ import:
**请求 = http.构建请求("POST", "/echo", [["Host", "example.test"], ["Content-Length", "2"]], "ok")**
*[响应.状态, 响应.原因, 响应.头["Content-Type"], 响应.体, 请求]*
**响应字节 = http.解析响应字节(http.文本字节("HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n6\r\n你好\r\n0\r\n\r\n"))**
**正文 = http.字节文本(响应字节.value.body)**
**请求字节 = http.构建请求字节("POST", "/", [], [65, 66])**
**请求文本 = http.字节文本(请求字节)**
*[响应.状态, 响应.原因, 响应.头["Content-Type"], 响应.体, 请求, 响应字节.value.status, 正文.value, 请求文本.value]*