1[package]
2name = "reqwest"
3version = "0.11.27" # remember to update html_root_url
4description = "higher level HTTP client library"
5keywords = ["http", "request", "client"]
6categories = ["web-programming::http-client", "wasm"]
7repository = "https://github.com/seanmonstar/reqwest"
8documentation = "https://docs.rs/reqwest"
9authors = ["Sean McArthur <sean@seanmonstar.com>"]
10readme = "README.md"
11license = "MIT OR Apache-2.0"
12edition = "2021"
13rust-version = "1.63.0"
14autotests = true
15
16[package.metadata.docs.rs]
17all-features = true
18rustdoc-args = ["--cfg", "docsrs", "--cfg", "reqwest_unstable"]
19targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
20
21[package.metadata.playground]
22features = [
23 "blocking",
24 "cookies",
25 "json",
26 "multipart",
27]
28
29[features]
30default = ["default-tls"]
31
32# Note: this doesn't enable the 'native-tls' feature, which adds specific
33# functionality for it.
34default-tls = ["hyper-tls", "native-tls-crate", "__tls", "tokio-native-tls"]
35
36# Enables native-tls specific functionality not available by default.
37native-tls = ["default-tls"]
38native-tls-alpn = ["native-tls", "native-tls-crate/alpn"]
39native-tls-vendored = ["native-tls", "native-tls-crate/vendored"]
40
41rustls-tls = ["rustls-tls-webpki-roots"]
42rustls-tls-manual-roots = ["__rustls"]
43rustls-tls-webpki-roots = ["webpki-roots", "__rustls"]
44rustls-tls-native-roots = ["rustls-native-certs", "__rustls"]
45
46blocking = ["futures-util/io", "tokio/sync"]
47
48cookies = ["cookie_crate", "cookie_store"]
49
50gzip = ["async-compression", "async-compression/gzip", "tokio-util"]
51
52brotli = ["async-compression", "async-compression/brotli", "tokio-util"]
53
54deflate = ["async-compression", "async-compression/zlib", "tokio-util"]
55
56json = ["serde_json"]
57
58multipart = ["mime_guess"]
59
60# Deprecated, remove this feature while bumping minor versions.
61trust-dns = ["hickory-dns"]
62hickory-dns = ["hickory-resolver"]
63
64stream = ["tokio/fs", "tokio-util", "wasm-streams"]
65
66socks = ["tokio-socks"]
67
68# Experimental HTTP/3 client.
69http3 = ["rustls-tls-manual-roots", "h3", "h3-quinn", "quinn", "futures-channel"]
70
71# Internal (PRIVATE!) features used to aid testing.
72# Don't rely on these whatsoever. They may disappear at anytime.
73
74# Enables common types used for TLS. Useless on its own.
75__tls = ["dep:rustls-pemfile"]
76
77# Enables common rustls code.
78# Equivalent to rustls-tls-manual-roots but shorter :)
79__rustls = ["hyper-rustls", "tokio-rustls", "rustls", "__tls"]
80
81# When enabled, disable using the cached SYS_PROXIES.
82__internal_proxy_sys_no_cache = []
83
84[dependencies]
85base64 = "0.21"
86http = "0.2"
87url = "2.2"
88bytes = "1.0"
89serde = "1.0"
90serde_urlencoded = "0.7.1"
91tower-service = "0.3"
92futures-core = { version = "0.3.0", default-features = false }
93futures-util = { version = "0.3.0", default-features = false }
94sync_wrapper = "0.1.2"
95
96# Optional deps...
97
98## json
99serde_json = { version = "1.0", optional = true }
100## multipart
101mime_guess = { version = "2.0", default-features = false, optional = true }
102
103[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
104encoding_rs = "0.8"
105http-body = "0.4.0"
106hyper = { version = "0.14.21", default-features = false, features = ["tcp", "http1", "http2", "client", "runtime"] }
107h2 = "0.3.14"
108once_cell = "1"
109log = "0.4"
110mime = "0.3.16"
111percent-encoding = "2.1"
112tokio = { version = "1.0", default-features = false, features = ["net", "time"] }
113pin-project-lite = "0.2.0"
114ipnet = "2.3"
115
116# Optional deps...
117rustls-pemfile = { version = "1.0", optional = true }
118
119## default-tls
120hyper-tls = { version = "0.5", optional = true }
121native-tls-crate = { version = "0.2.10", optional = true, package = "native-tls" }
122tokio-native-tls = { version = "0.3.0", optional = true }
123
124# rustls-tls
125hyper-rustls = { version = "0.24.0", default-features = false, optional = true }
126rustls = { version = "0.21.6", features = ["dangerous_configuration"], optional = true }
127tokio-rustls = { version = "0.24", optional = true }
128webpki-roots = { version = "0.25", optional = true }
129rustls-native-certs = { version = "0.6", optional = true }
130
131## cookies
132cookie_crate = { version = "0.17.0", package = "cookie", optional = true }
133cookie_store = { version = "0.20.0", optional = true }
134
135## compression
136async-compression = { version = "0.4.0", default-features = false, features = ["tokio"], optional = true }
137tokio-util = { version = "0.7.1", default-features = false, features = ["codec", "io"], optional = true }
138
139## socks
140tokio-socks = { version = "0.5.1", optional = true }
141
142## hickory-dns
143hickory-resolver = { version = "0.24", optional = true, features = ["tokio-runtime"] }
144
145# HTTP/3 experimental support
146h3 = { version = "0.0.3", optional = true }
147h3-quinn = { version = "0.0.4", optional = true }
148quinn = { version = "0.10", default-features = false, features = ["tls-rustls", "ring", "runtime-tokio"], optional = true }
149futures-channel = { version = "0.3", optional = true }
150
151
152[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
153env_logger = "0.10"
154hyper = { version = "0.14", default-features = false, features = ["tcp", "stream", "http1", "http2", "client", "server", "runtime"] }
155serde = { version = "1.0", features = ["derive"] }
156libflate = "1.0"
157brotli_crate = { package = "brotli", version = "3.3.0" }
158doc-comment = "0.3"
159tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread"] }
160futures-util = { version = "0.3.0", default-features = false, features = ["std", "alloc"] }
161
162[target.'cfg(windows)'.dependencies]
163winreg = "0.50.0"
164
165[target.'cfg(target_os = "macos")'.dependencies]
166system-configuration = "0.5.1"
167
168# wasm
169
170[target.'cfg(target_arch = "wasm32")'.dependencies]
171js-sys = "0.3.45"
172serde_json = "1.0"
173wasm-bindgen = "0.2.68"
174wasm-bindgen-futures = "0.4.18"
175wasm-streams = { version = "0.4", optional = true }
176
177[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
178version = "0.3.25"
179features = [
180 "AbortController",
181 "AbortSignal",
182 "Headers",
183 "Request",
184 "RequestInit",
185 "RequestMode",
186 "Response",
187 "Window",
188 "FormData",
189 "Blob",
190 "BlobPropertyBag",
191 "ServiceWorkerGlobalScope",
192 "RequestCredentials",
193 "File",
194 "ReadableStream"
195]
196
197[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
198wasm-bindgen = { version = "0.2.68", features = ["serde-serialize"] }
199wasm-bindgen-test = "0.3"
200
201[[example]]
202name = "blocking"
203path = "examples/blocking.rs"
204required-features = ["blocking"]
205
206[[example]]
207name = "json_dynamic"
208path = "examples/json_dynamic.rs"
209required-features = ["json"]
210
211[[example]]
212name = "json_typed"
213path = "examples/json_typed.rs"
214required-features = ["json"]
215
216[[example]]
217name = "tor_socks"
218path = "examples/tor_socks.rs"
219required-features = ["socks"]
220
221[[example]]
222name = "form"
223path = "examples/form.rs"
224
225[[example]]
226name = "simple"
227path = "examples/simple.rs"
228
229[[test]]
230name = "blocking"
231path = "tests/blocking.rs"
232required-features = ["blocking"]
233
234[[test]]
235name = "cookie"
236path = "tests/cookie.rs"
237required-features = ["cookies"]
238
239[[test]]
240name = "gzip"
241path = "tests/gzip.rs"
242required-features = ["gzip"]
243
244[[test]]
245name = "brotli"
246path = "tests/brotli.rs"
247required-features = ["brotli"]
248
249[[test]]
250name = "deflate"
251path = "tests/deflate.rs"
252required-features = ["deflate"]
253
254[[test]]
255name = "multipart"
256path = "tests/multipart.rs"
257required-features = ["multipart"]
258