Streaming HTTP protocol suite for MoonBit with HTTP/1.0, HTTP/1.1, HTTP/2, HTTP/3, QUIC, TLS integration, and policy-driven transports.
moon add ZSeanYves/http@0.8.0import {
"ZSeanYves/http/protocol/http1",
} for "test"test "decode a request" {
let decoder = @http1.RequestDecoder::new()
decoder.feed(b"GET /hello HTTP/1.1\r\nHost: localhost\r\n\r\n").unwrap()
guard decoder.next() is Ok(Some(RequestHead(head))) else {
fail("expected request headers")
}
assert_eq(head.uri.value, "/hello")
assert_true(decoder.next() is Ok(Some(RequestEnd)))
}Install
Download zipStreaming HTTP protocol suite for MoonBit with HTTP/1.0, HTTP/1.1, HTTP/2, HTTP/3, QUIC, TLS integration, and policy-driven transports.