web-faith 0.7.0

A browser-shaped HTTP client: fetch semantics over a Rust network stack
web-faith-0.7.0 has been yanked.
Visit the last successful build: web-faith-1.1.0

A browser-shaped HTTP client: fetch semantics over a Rust network stack.

Faith behaves like a browser wherever that translates to a server-side runtime: transparent HTTP/2 and HTTP/3, Happy Eyeballs across IPv4 and IPv6, DNS caching, an optional cookie jar, and HTTP caching. The subsystems beneath it are published on their own, and each can be left out of a build with the feature named for it.

Whichever layer a request fails in, the failure arrives as one [FaithError] whose [FaithErrorKind] is the stable code to match on: a component crate names its own errors, and they are converted at the boundary as they cross into the client.

# use web_faith::agent::Agent;
# async fn example() -> Result<(), web_faith::FaithError> {
let agent = Agent::new()?;
let body = agent.fetch("https://example.com/").await?.text().await?;
# Ok(())
# }

An Agent owns the connection pool, resolver, cookie jar, and caches; Agent::builder configures one. Cloning an agent is cheap and every clone names the same one.

Agent::fetch returns a builder that sends when awaited, so there is no separate send step. Request prepares one without sending it, to adjust at each call site or send unchanged on more than one agent.