[package]
name = "tower-http-client"
description = "Extra Tower middlewares and utilities for HTTP clients."
documentation = "https://docs.rs/crate/tower-http-client"
readme = "README.md"

version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
categories.workspace = true
keywords.workspace = true
rust-version.workspace = true

[dependencies]
tower-reqwest = { workspace = true, optional = true }

bytes = { workspace = true }
futures-util = { workspace = true }
http = { workspace = true }
http-body = { workspace = true }
http-body-reader = { workspace = true }
http-body-util = { workspace = true }
include-utils = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true, optional = true }
serde_urlencoded = { workspace = true, optional = true }
thiserror = { workspace = true }
tower = { workspace = true, default-features = false, features = ["util"] }
tower-layer = { workspace = true }
tower-service = { workspace = true }
url = { workspace = true }

[dev-dependencies]
tower-reqwest = { workspace = true }

anyhow = { workspace = true }
reqwest = { workspace = true }
retry-policies = { workspace = true }
tokio = { workspace = true }
tower = { workspace = true, features = ["util", "buffer", "limit", "retry"] }
tower-http = { workspace = true, features = ["set-header", "util", "map-request-body"] }
wiremock = { workspace = true }

[features]
default = ["json", "reqwest", "form"]
json = ["dep:serde_json", "http-body-reader/json"]
reqwest = ["dep:tower-reqwest"]
form = ["dep:serde_urlencoded", "http-body-reader/form"]

[[example]]
name = "rate_limiter"
required-features = ["reqwest"]

[[example]]
name = "retry"
required-features = ["reqwest"]

[[example]]
name = "send_json"
required-features = ["reqwest", "json"]

[[example]]
name = "send_form"
required-features = ["reqwest", "form"]

[[test]]
name = "service_ext"
required-features = ["reqwest"]

[lints]
workspace = true

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