packages

http

0.1.0공식

HTTP/1.1 and HTTP/2 client and server: strict parsing, HPACK, streaming bodies, connection pooling

공개 · MIT OR Apache-2.0 · 의존성 0개

공식 패키지: use http::..;만 쓰면 첫 빌드가 추가합니다. 또는:

nabi add http

그다음 코드에서

use http;
deps: {
    "http": Dep::version("^0.1.0"),
},

CI packages.nabi-lang.org License: MIT OR Apache-2.0

HTTP/1.1 and HTTP/2 for Nabi: a message model, a pooling client and an async server, over plaintext or TLS 1.3. Built on std::net with no other dependencies. Parsing is strict where leniency would allow request smuggling or response splitting.

Add it

nabi add http

Needs Nabi 0.1 or later.

Features http1, http2 and tls are on by default; turn off what you do not need with default_features: false.

Usage

// One-off request with a default client.
async fn main() throws {
    let r = try await http::get("http://example.com/");
    println(f"{r.status} {r.headers.get("content-type") ?? "-"}");
    println(try await r.body.text());
}

The server is router-free: one async fn(Request) -> Response handler, served with http::serve / http::serve_tls. See the API docs for the client, server and TLS details.

Docs

https://packages.nabi-lang.org/packages/http/latest/docs

License

Licensed under either of MIT or Apache-2.0, at your option.

README 출처: github.com/nabi-lang/http, 커밋 40606e55.