feat(stdlib): add HTTP framing over TCP and close P5 C10 locally
- Add stdlib/net/http.mq.md: status/header/chunked response parsing and request
construction in .mq.md; no host HTTP/TLS implementation.
- Add stdlib/tests/http.mq.md and an end-to-end loopback test that sends a GET
over resource.open("tcp"), reads bytes, parses the response and returns
status/content-type/body.
- Update ADR-0034, status/spec/README/changelog and evidence; refresh the
bundle digest.
Gate: fmt, clippy -D warnings, 430 tests passed.
This commit is contained in:
1 parent
0d4dc1da03
commit
e981168d92
11 files changed
+486
-4
No files matched your search
@@ -0,0 +1,14 @@
|
||||
---
|
||||
import:
|
||||
http: "std:net/http"
|
||||
---
|
||||
|
||||
## main
|
||||
|
||||
**响应文本 = "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nhello\r\n6\r\n world\r\n0\r\n\r\n"**
|
||||
|
||||
**响应 = http.解析响应(响应文本)**
|
||||
|
||||
**请求 = http.构建请求("POST", "/echo", [["Host", "example.test"], ["Content-Length", "2"]], "ok")**
|
||||
|
||||
*[响应.状态, 响应.原因, 响应.头["Content-Type"], 响应.体, 请求]*
|
||||
Reference in new issue
Block a user