[package]
name = "ehttp"
version = "0.5.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
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 = []
json = ["dep:serde", "dep:serde_json"]
multipart = ["dep:getrandom", "dep:mime", "dep:mime_guess", "dep:rand"]
native-async = ["async-channel"]
streaming = ["dep:wasm-streams", "dep:futures-util"]
[dependencies]
document-features = "0.2"
mime = { version = "0.3", optional = true }
mime_guess = { version = "2.0", optional = true }
rand = { version = "0.8.5", optional = true }
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ureq = "2.0"
async-channel = { version = "2.0", optional = true }
[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3"
wasm-bindgen = "0.2.89"
wasm-bindgen-futures = "0.4"
getrandom = { version = "0.2.10", features = ["js"], optional = true }
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",
] }