reqwest-cross 0.5.1

Wrapper around reqwest for use in both native and wasm
Documentation
[package]
name = "reqwest-cross"
version = "0.5.1"
authors = ["One <one.bgz1@gmail.com>"]
categories = ["web-programming::http-client", "wasm"]
documentation = "https://docs.rs/reqwest-cross"
edition = "2021"
keywords = ["http", "wasm", "native", "web", "request"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/c-git/reqwest-cross"
description = "Wrapper around reqwest for use in both native and wasm"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package.metadata.docs.rs]
all-features = true

[dependencies]
anyhow = "1.0.95"
document-features = "0.2.10"
egui = { version = "0.30.0", default-features = false, optional = true }
futures = "0.3.28"
rand = "0.8.5"
reqwest = { version = "0.12.12", default-features = false }
thiserror = "2.0.9"
tracing = "0.1.41"

# For native compilation
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1", default-features = false, optional = true }

# For compiling to wasm:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4.34"
js-sys = { version = "0.3.69", optional = true }
web-sys = { version = "0.3.69", optional = true }
getrandom = { version = "0.2.15", features = ["js"] }

[dev-dependencies]
wasm-bindgen-test = "0.3.34"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
tokio = { version = "1.27.0", default-features = false, features = [
    "macros",
    "rt-multi-thread",
] }

[[example]]
name = "loop_yield_custom"
required-features = ["yield_now"]

[[example]]
name = "loop_yield_data_state"
required-features = ["yield_now"]

[features]
## Enables the tokio runtime and reqwest's default features.
## If default-features gets disabled do ensure you at least enable tls, unless you explicitly do not want tls support.
default = ["native-tokio", "reqwest_default"]

## Enables reqwest's default features
reqwest_default = ["reqwest/default"]

## Sets [tokio][tokio-url] as the runtime to use for native
native-tokio = ["dep:tokio"]

## Add a function that can be called to yield to the executor.
## This is only needed if you only have one thread and need to release it to prevent a deadlock
## because you are waiting on another future (as can be the case in WASM). If you are using a
## framework such as egui this may not be necessary as they already allow for other futures to
## make progress. But one test will quickly let you know either way. If the program freezes
## after you make a request then this can help.
yield_now = ["dep:js-sys", "dep:web-sys"]

## Add helper functions to ['DataState'] to do egui boiler plate
egui = ["dep:egui"]

#! The following enable a subset of reqwest's features.
#! If you need a feature that we didn't include please open an issue and let us know and we'll add it.
#! In the mean while you can depend on reqwest directly with the same version as this crate and enable the feature.
#! Because features are additive it will be enabled but note that if the version goes out of sync it will cause compilation issues.

## Enables the feature with the same name on reqwest
default-tls = ["reqwest/default-tls"]
## Enables the feature with the same name on reqwest
native-tls = ["reqwest/native-tls"]
## Enables the feature with the same name on reqwest
rustls-tls = ["reqwest/rustls-tls"]
## Enables the feature with the same name on reqwest
http2 = ["reqwest/http2"]
## Enables the feature with the same name on reqwest
json = ["reqwest/json"]
## Enables the feature with the same name on reqwest
cookies = ["reqwest/cookies"]
## Enables the feature with the same name on reqwest
hickory-dns = ["reqwest/hickory-dns"]
## Enables the feature with the same name on reqwest
multipart = ["reqwest/multipart"]
## Enables the feature with the same name on reqwest
socks = ["reqwest/socks"]
## Enables the feature with the same name on reqwest
stream = ["reqwest/stream"]
## Enables the feature with the same name on reqwest
brotli = ["reqwest/brotli"]
## Enables the feature with the same name on reqwest
deflate = ["reqwest/deflate"]
## Enables the feature with the same name on reqwest
gzip = ["reqwest/gzip"]
## Enables the feature with the same name on reqwest
zstd = ["reqwest/zstd"]