[package] name = "ianaio-net" version = "0.1.0" authors = [ "IanaIO Rust and WebAssembly Working Group", "Jaroslaw Cichon ", ] edition = "2021" license-file = "LICENSE.txt" repository = "https://github.com/rustwasm/ianaio" description = "HTTP requests library for WASM Apps" homepage = "https://rustwasm.iana.io/net" documentation = "https://docs.iana.io/rustwasm/net" readme = "README.md" keywords = ["requests", "http", "wasm", "websockets"] categories = ["wasm", "web-programming::http-client", "api-bindings"] rust-version = "1.80" [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] wasm-bindgen = "0.2" web-sys = "0.3" js-sys = "0.3" ianaio-utils = { version = "0.1.0", 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", "ianaio-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/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', ] # 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"]