Skip to main content

Module http

Module http 

Source
Available on crate features transport-http and transport only.
Expand description

§HTTP Transport

HTTP/HTTPS transport for webhook delivery and REST ingest.

§Send

POSTs payload bytes to {endpoint}/{key} using reqwest.

§Receive (requires http-server feature)

Starts an embedded axum HTTP server that accepts POST requests on a configurable path. Incoming payloads are queued into a bounded tokio::sync::mpsc channel. recv() drains from this channel.

§Example

use hyperi_rustlib::transport::http::{HttpTransport, HttpTransportConfig};

// Send-only
let config = HttpTransportConfig {
    endpoint: Some("http://loader:8080/ingest".into()),
    ..Default::default()
};
let transport = HttpTransport::new(&config).await?;
transport.send("events", bytes::Bytes::from_static(b"{\"msg\":\"hello\"}")).await;

Structs§

HttpToken
Commit token for HTTP transport.
HttpTransport
HTTP/HTTPS transport.
HttpTransportConfig
Configuration for HTTP transport.