Expand description
Rig’s transport contracts. A transport implements
HttpClientExt (and, for websocket sessions,
WebSocketClientExt), and every Rig
provider sends through it. This crate holds no transport of its own:
rig-reqwest and rig-tungstenite are the bundled ones. rig-core
re-exports these modules at rig_core::http_client, rig_core::ws_client
and rig_core::wasm_compat.
use rig_http::http_client::{HeaderMap, bearer_auth_header};
let mut headers = HeaderMap::new();
bearer_auth_header(&mut headers, "example-token")?;Modules§
- http_
client - Transport-independent HTTP requests, lazy response bodies, and errors.
- test_
utils test-utils - HTTP client doubles for tests of code that sends through an
HttpClientExt. - wasm_
compat - Target-dependent thread bounds, boxed futures, and executor-independent timers.
- ws_
client websocket - Transport-independent websocket handshakes, connections, and frames. Backends preserve rejected upgrades as HTTP errors with status, headers, and body.