[package]
name = "gloo-net"
version = "0.2.6"
authors = ["Rust and WebAssembly Working Group", "Muhammad Hamza <muhammadhamza1311@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rustwasm/gloo"
description = "HTTP requests library for WASM Apps"
readme = "README.md"
keywords = ["requests", "http", "wasm", "websockets"]
categories = ["wasm", "web-programming::http-client", "api-bindings"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
wasm-bindgen = "0.2"
web-sys = "0.3"
js-sys = "0.3"
gloo-utils = { version = "0.1", path = "../utils", default-features = false }
wasm-bindgen-futures = "0.4"
futures-core = { version = "0.3", optional = true }
futures-sink = { version = "0.3", optional = true }
thiserror = "1.0"
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
futures-channel = { version = "0.3", optional = true }
pin-project = { version = "1.0", optional = true }
[dev-dependencies]
wasm-bindgen-test = "0.3"
futures = "0.3"
serde = { version = "1.0", features = ["derive"] }
once_cell = "1"
[features]
default = ["json", "websocket", "http", "eventsource"]
json = ["serde", "serde_json", "gloo-utils/serde"]
websocket = [
'web-sys/WebSocket',
'web-sys/AddEventListenerOptions',
'web-sys/ErrorEvent',
'web-sys/FileReader',
'web-sys/MessageEvent',
'web-sys/ProgressEvent',
'web-sys/CloseEvent',
'web-sys/CloseEventInit',
'web-sys/BinaryType',
'web-sys/Blob',
"futures-channel",
"futures-core",
"futures-sink",
"pin-project",
]
http = [
'web-sys/Headers',
'web-sys/UrlSearchParams',
'web-sys/Url',
'web-sys/Request',
'web-sys/RequestInit',
'web-sys/RequestMode',
'web-sys/Response',
'web-sys/ResponseType',
'web-sys/Window',
'web-sys/RequestCache',
'web-sys/RequestCredentials',
'web-sys/ObserverCallback',
'web-sys/RequestRedirect',
'web-sys/ReferrerPolicy',
'web-sys/AbortSignal',
'web-sys/ReadableStream',
'web-sys/Blob',
'web-sys/FormData',
'web-sys/WorkerGlobalScope',
]
eventsource = [
"futures-channel",
"futures-core",
"pin-project",
'web-sys/Event',
'web-sys/EventTarget',
'web-sys/EventSource',
'web-sys/MessageEvent',
]