[package]
name = "cyper"
version = "0.7.0"
description = "HTTP client library based on compio and hyper"
categories = ["asynchronous", "network-programming"]
keywords = ["async", "net"]
edition = { workspace = true }
authors = { workspace = true }
readme = { workspace = true }
license = { workspace = true }
repository = { workspace = true }

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

[dependencies]
compio = { workspace = true, features = ["time", "bytes", "tls"] }
compio-quic = { workspace = true, optional = true, features = [
    "platform-verifier",
] }
cyper-core = { workspace = true }

http = "1.0.0"
hyper = { workspace = true, features = ["client", "http1"] }
hyper-util = { workspace = true, features = ["client-legacy", "http1"] }
h3 = { version = "0.0.8", optional = true }

nyquest-interface = { version = "0.3.0", optional = true }

rustls-platform-verifier = { workspace = true, optional = true }

async-stream = "0.3"
base64 = "0.22"
cfg-if = { workspace = true }
cookie_store = { version = "0.22", optional = true }
encoding_rs = "0.8"
futures-util = { workspace = true }
http-body-util = "0.1.0"
mime = "0.3"
mime_guess = { version = "2.0", default-features = false, optional = true }
once_cell = { version = "1", optional = true }
percent-encoding = { version = "2.3", optional = true }
send_wrapper = { workspace = true, features = ["futures"] }
serde = "1"
serde_json = { version = "1", optional = true }
serde_urlencoded = "0.7"
socket2 = { workspace = true, optional = true }
thiserror = "2"
tower-service = { workspace = true }
url = "2"

[dev-dependencies]
compio = { workspace = true, features = ["macros"] }
cyper-axum = { workspace = true }
rustls = { workspace = true, features = ["ring"] }

nyquest = { version = "0.3.0" }

axum = { workspace = true }
clap = { version = "4", features = ["derive"] }
cookie = "0.18"
futures-channel = { workspace = true }
serde = { version = "1", features = ["derive"] }
time = "0.3"
tower = { workspace = true }

[features]
default = ["native-tls"]
native-tls = ["compio/native-tls"]
rustls = ["compio/rustls", "dep:rustls-platform-verifier"]
cookies = ["dep:cookie_store"]
json = ["dep:serde_json"]
http2 = ["hyper-util/http2"]
http3 = [
    "dep:compio-quic",
    "dep:h3",
    "dep:once_cell",
    "dep:socket2",
    "compio/h3",
    "rustls",
]
http3-altsvc = ["http3"]
stream = []
multipart = ["stream", "dep:mime_guess", "dep:percent-encoding"]
all = [
    "cookies",
    "json",
    "native-tls",
    "rustls",
    "http2",
    "http3",
    "http3-altsvc",
    "stream",
    "multipart",
]

nyquest = ["dep:nyquest-interface", "stream", "compio/fd-sync"]
nyquest-async = ["nyquest", "nyquest/async", "nyquest-interface/async"]
nyquest-blocking = ["nyquest", "nyquest/blocking", "nyquest-interface/blocking"]
nyquest-multipart = [
    "nyquest",
    "multipart",
    "nyquest/multipart",
    "nyquest-interface/multipart",
]
nyquest-all = ["nyquest-async", "nyquest-blocking", "nyquest-multipart"]

once_cell_try = ["compio/once_cell_try"]
nightly = ["once_cell_try", "cyper-core/nightly", "cyper-axum/nightly"]

[[test]]
name = "cookie"
required-features = ["cookies"]

[[test]]
name = "multipart"
required-features = ["multipart"]

[[test]]
name = "nyquest"
required-features = ["nyquest"]
