[package] name = "ehttp" version = "0.5.0" authors = ["Emil Ernerfeldt "] description = "Minimal HTTP client for both native and WASM" edition = "2018" rust-version = "1.72" homepage = "https://github.com/emilk/ehttp" license = "MIT OR Apache-2.0" readme = "../README.md" repository = "https://github.com/emilk/ehttp" categories = ["network-programming", "wasm", "web-programming"] keywords = ["http", "wasm", "native", "web"] include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml"] [package.metadata.docs.rs] all-features = true [lib] [features] default = [] ## Support json fetch json = ["dep:serde", "dep:serde_json"] ## Support multipart fetch multipart = ["dep:getrandom", "dep:mime", "dep:mime_guess", "dep:rand"] ## Support `fetch_async` on native native-async = ["async-channel"] ## Support streaming fetch streaming = ["dep:wasm-streams", "dep:futures-util"] [dependencies] document-features = "0.2" # Multipart request mime = { version = "0.3", optional = true } mime_guess = { version = "2.0", optional = true } rand = { version = "0.8.5", optional = true } # Json request serde = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true } # For compiling natively: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # ureq = { version = "2.0", default-features = false, features = ["gzip", "tls_native_certs"] } ureq = "2.0" async-channel = { version = "2.0", optional = true } # For compiling to web: [target.'cfg(target_arch = "wasm32")'.dependencies] js-sys = "0.3" wasm-bindgen = "0.2.89" wasm-bindgen-futures = "0.4" # Multipart request getrandom = { version = "0.2.10", features = ["js"], optional = true } # Streaming response futures-util = { version = "0.3", optional = true } wasm-streams = { version = "0.4", optional = true } web-sys = { version = "0.3.52", features = [ "AbortSignal", "console", "Headers", "ReadableStream", "Request", "RequestInit", "RequestMode", "Response", "Window", ] }