httpmock 0.9.0

HTTP mocking library for Rust
Documentation
[package]
name = "httpmock"
version = "0.9.0"
authors = ["Alexander Liesenfeld <alexander.liesenfeld@outlook.com>", "Falk Woldmann Lu <httpmock@woldmann.lu>"]
edition = "2024"
description = "HTTP mocking library for Rust"
readme = "README.md"
keywords = ["http", "mock", "test"]
categories = ["development-tools::testing"]
license = "MIT"
repository = "https://github.com/httpmock/httpmock"
rust-version = "1.88.0"
exclude = [".github/", "assets/", "docs/", "scripts/", "codecov.yml", "funding.json", "tarpaulin*.toml"]

[lints.rust]
# Gate the `warnings` group at error level so new rustc warnings fail CI. The
# allowed lints are a temporary allow list that should be removed over time.
warnings = { level = "deny", priority = -1 }
redundant_imports = "warn"
unused_extern_crates = "warn"
unsafe_code = "forbid"

[lints.clippy]
# `priority = -1` keeps the group below the individual entries that follow it, so a specific
# lint level always wins over the group. Without it the group shares the default priority and
# silently overrides any entry that sorts before "all".
all = { level = "deny", priority = -1 }
redundant_clone = "deny"

[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
base64 = "0.23"
regex = "1"
tracing = { version = "0.1", features = ["log"] }
assert-json-diff = "2"
similar = "3"
form_urlencoded = "1"
thiserror = "2"
path-tree = ">=0.8.0, <0.8.4"
http = "1"
bytes = { version = "1", features = ["serde"] }
hyper = { version = "1", features = ["server", "http1", "client"] }
hyper-util = { version = "0.1", features = ["tokio", "server", "http1"] }
http-body-util = "0.1"
tokio = { version = "1", features = ["sync", "macros", "rt-multi-thread", "net"] }
colored = { version = "3", optional = true }
clap = { version = "4", features = ["derive", "env"], optional = true }
serde_yaml = { version = "0.9", optional = true }
headers = { version = "0.4", optional = true }

### TLS / HTTPS / PROXY
rustls = { version = "0.23", default-features = false, features = ["std", "tls12"], optional = true }
rcgen = { version = "0.14", features = ["pem", "x509-parser"], optional = true }
tokio-rustls = { version = "0.26", default-features = false, features = ["logging", "tls12"], optional = true }
rustls-pki-types = { version = "1", optional = true }
if-addrs = { version = "0.15", optional = true }
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "logging", "tls12", "native-tokio"], optional = true }
futures-timer = "3"
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }

[dev-dependencies]
actix-rt = "2"
reqwest = { version = "0.13", features = ["blocking", "cookies", "query"] }
urlencoding = "2"
smol = "2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[features]
default = ["cookies"]
standalone =  ["dep:clap", "tokio/signal", "dep:tracing-subscriber", "record", "http2", "cookies", "remote", "remote-https"] # enables standalone mode
color = ["dep:colored"] # enables colorful output in standalone mode
cookies = ["dep:headers"] # enables support for matching cookies
remote = ["hyper-util/client-legacy", "hyper-util/http2"] # allows to connect to remote mock servers
remote-https = ["remote", "dep:rustls", "rustls/ring", "dep:hyper-rustls", "hyper-rustls/ring", "hyper-rustls/http2"] # allows to connect to remote mock servers via HTTPS
proxy = ["remote-https", "hyper-util/client-legacy", "hyper-util/http2", "dep:hyper-rustls", "hyper-rustls/http2"] # enables proxy functionality
https = ["dep:rustls", "dep:rcgen", "dep:tokio-rustls", "dep:hyper-rustls", "dep:rustls-pki-types", "rustls/ring", "hyper-rustls/ring", "dep:if-addrs"] # enables httpmock server support for TLS/HTTPS
http2 = ["hyper/http2", "hyper-util/http2", "hyper-util/server-auto", "hyper-rustls?/http2"] # enables httpmocks server support for HTTP2
record = ["proxy", "dep:serde_yaml"]

[[bin]]
name = "httpmock"
required-features = ["standalone"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]