[package] name = "gloo-net" version = "0.6.0" authors = [ "Rust and WebAssembly Working Group", "Elina ", ] edition = "2021" 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"] rust-version = "1.64" [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.2", path = "../utils", default-features = false } wasm-bindgen-futures = "0.4" futures-core = { version = "0.3", optional = true } futures-sink = { version = "0.3", optional = true } futures-io = { 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 } http = "1.0" [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"] # Enables `.json()` on `Response` json = ["serde", "serde_json", "gloo-utils/serde"] # Enables the WebSocket API 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", ] # Enables the HTTP API http = [ 'web-sys/Headers', 'web-sys/UrlSearchParams', 'web-sys/Url', 'web-sys/Request', 'web-sys/RequestInit', 'web-sys/RequestMode', 'web-sys/Response', 'web-sys/ResponseInit', 'web-sys/ResponseType', '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', ] # Enables the EventSource API eventsource = [ "futures-channel", "futures-core", "pin-project", 'web-sys/Event', 'web-sys/EventTarget', 'web-sys/EventSource', 'web-sys/MessageEvent', ] # As of now, only implements `AsyncRead` and `AsyncWrite` on `WebSocket` io-util = ["futures-io"]