|
| 1 | +[package] |
| 2 | +name = "gloo-net" |
| 3 | +version = "0.1.0" |
| 4 | +authors = [ "Rust and WebAssembly Working Group", "Muhammad Hamza <[email protected]>"] |
| 5 | +edition = "2018" |
| 6 | +license = "MIT OR Apache-2.0" |
| 7 | +repository = "https://github.com/hamza1311/reqwasm" |
| 8 | +description = "HTTP requests library for WASM Apps" |
| 9 | +readme = "README.md" |
| 10 | +keywords = ["requests", "http", "wasm", "websockets"] |
| 11 | +categories = ["wasm", "web-programming::http-client", "api-bindings"] |
| 12 | + |
| 13 | +[package.metadata.docs.rs] |
| 14 | +all-features = true |
| 15 | + |
| 16 | +[dependencies] |
| 17 | +wasm-bindgen = "0.2" |
| 18 | +web-sys = "0.3" |
| 19 | +js-sys = "0.3" |
| 20 | +gloo-utils = { version = "0.1", path = "../utils" } |
| 21 | + |
| 22 | +wasm-bindgen-futures = "0.4" |
| 23 | +futures-core = { version = "0.3", optional = true } |
| 24 | +futures-sink = { version = "0.3", optional = true } |
| 25 | + |
| 26 | +thiserror = "1.0" |
| 27 | + |
| 28 | +serde = { version = "1.0", features = ["derive"], optional = true } |
| 29 | +serde_json = { version = "1.0", optional = true } |
| 30 | + |
| 31 | +futures-channel = { version = "0.3", optional = true } |
| 32 | +pin-project = { version = "1.0", optional = true } |
| 33 | + |
| 34 | +[dev-dependencies] |
| 35 | +wasm-bindgen-test = "0.3" |
| 36 | +futures = "0.3" |
| 37 | + |
| 38 | +[features] |
| 39 | +default = ["json", "websocket", "http"] |
| 40 | + |
| 41 | +# Enables `.json()` on `Response` |
| 42 | +json = ["wasm-bindgen/serde-serialize", "serde", "serde_json"] |
| 43 | +# Enables the WebSocket API |
| 44 | +websocket = [ |
| 45 | + 'web-sys/WebSocket', |
| 46 | + 'web-sys/ErrorEvent', |
| 47 | + 'web-sys/FileReader', |
| 48 | + 'web-sys/MessageEvent', |
| 49 | + 'web-sys/ProgressEvent', |
| 50 | + 'web-sys/CloseEvent', |
| 51 | + 'web-sys/BinaryType', |
| 52 | + 'web-sys/Blob', |
| 53 | + "futures-channel", |
| 54 | + "pin-project", |
| 55 | + "futures-core", |
| 56 | + "futures-sink", |
| 57 | +] |
| 58 | +# Enables the HTTP API |
| 59 | +http = [ |
| 60 | + 'web-sys/Headers', |
| 61 | + 'web-sys/Request', |
| 62 | + 'web-sys/RequestInit', |
| 63 | + 'web-sys/RequestMode', |
| 64 | + 'web-sys/Response', |
| 65 | + 'web-sys/Window', |
| 66 | + 'web-sys/RequestCache', |
| 67 | + 'web-sys/RequestCredentials', |
| 68 | + 'web-sys/ObserverCallback', |
| 69 | + 'web-sys/RequestRedirect', |
| 70 | + 'web-sys/ReferrerPolicy', |
| 71 | + 'web-sys/AbortSignal', |
| 72 | + 'web-sys/ReadableStream', |
| 73 | + 'web-sys/Blob', |
| 74 | + 'web-sys/FormData', |
| 75 | +] |
0 commit comments