1[package]
2name = "reqwest"
3version = "0.12.15"
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.64.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", "charset", "http2", "macos-system-configuration"]
31
32# Note: this doesn't enable the 'native-tls' feature, which adds specific
33# functionality for it.
34default-tls = ["dep:hyper-tls", "dep:native-tls-crate", "__tls", "dep:tokio-native-tls"]
35
36http2 = ["h2", "hyper/http2", "hyper-util/http2", "hyper-rustls?/http2"]
37
38# Enables native-tls specific functionality not available by default.
39native-tls = ["default-tls"]
40native-tls-alpn = ["native-tls", "native-tls-crate?/alpn", "hyper-tls?/alpn"]
41native-tls-vendored = ["native-tls", "native-tls-crate?/vendored"]
42
43rustls-tls = ["rustls-tls-webpki-roots"]
44rustls-tls-no-provider = ["rustls-tls-manual-roots-no-provider"]
45
46rustls-tls-manual-roots-no-provider = ["__rustls"]
47rustls-tls-webpki-roots-no-provider = ["dep:webpki-roots", "hyper-rustls?/webpki-tokio", "__rustls"]
48rustls-tls-native-roots-no-provider = ["dep:rustls-native-certs", "hyper-rustls?/native-tokio", "__rustls"]
49
50rustls-tls-manual-roots = ["rustls-tls-manual-roots-no-provider", "__rustls-ring"]
51rustls-tls-webpki-roots = ["rustls-tls-webpki-roots-no-provider", "__rustls-ring"]
52rustls-tls-native-roots = ["rustls-tls-native-roots-no-provider", "__rustls-ring"]
53
54blocking = ["dep:futures-channel", "futures-channel?/sink", "futures-util/io", "futures-util/sink", "tokio/sync"]
55
56charset = ["dep:encoding_rs"]
57
58cookies = ["dep:cookie_crate", "dep:cookie_store"]
59
60gzip = ["dep:async-compression", "async-compression?/gzip", "dep:tokio-util"]
61
62brotli = ["dep:async-compression", "async-compression?/brotli", "dep:tokio-util"]
63
64zstd = ["dep:async-compression", "async-compression?/zstd", "dep:tokio-util"]
65
66deflate = ["dep:async-compression", "async-compression?/zlib", "dep:tokio-util"]
67
68json = ["dep:serde_json"]
69
70multipart = ["dep:mime_guess"]
71
72# Deprecated, remove this feature while bumping minor versions.
73trust-dns = []
74hickory-dns = ["dep:hickory-resolver"]
75
76stream = ["tokio/fs", "dep:tokio-util", "dep:wasm-streams"]
77
78socks = ["dep:tokio-socks"]
79
80# Use the system's proxy configuration.
81macos-system-configuration = ["dep:system-configuration"]
82
83# Experimental HTTP/3 client.
84http3 = ["rustls-tls-manual-roots", "dep:h3", "dep:h3-quinn", "dep:quinn", "dep:slab", "dep:futures-channel"]
85
86
87# Internal (PRIVATE!) features used to aid testing.
88# Don't rely on these whatsoever. They may disappear at any time.
89
90# Enables common types used for TLS. Useless on its own.
91__tls = ["dep:rustls-pemfile", "tokio/io-util"]
92
93# Enables common rustls code.
94# Equivalent to rustls-tls-manual-roots but shorter :)
95__rustls = ["dep:hyper-rustls", "dep:tokio-rustls", "dep:rustls", "__tls", "dep:rustls-pemfile", "dep:rustls-pki-types"]
96__rustls-ring = ["hyper-rustls?/ring", "tokio-rustls?/ring", "rustls?/ring", "quinn?/ring"]
97
98[dependencies]
99base64 = "0.22"
100http = "1"
101url = "2.4"
102bytes = "1.2"
103serde = "1.0"
104serde_urlencoded = "0.7.1"
105tower-service = "0.3"
106futures-core = { version = "0.3.28", default-features = false }
107futures-util = { version = "0.3.28", default-features = false }
108sync_wrapper = { version = "1.0", features = ["futures"] }
109
110# Optional deps...
111
112## json
113serde_json = { version = "1.0", optional = true }
114## multipart
115mime_guess = { version = "2.0", default-features = false, optional = true }
116
117[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
118encoding_rs = { version = "0.8", optional = true }
119http-body = "1"
120http-body-util = "0.1"
121hyper = { version = "1.1", features = ["http1", "client"] }
122hyper-util = { version = "0.1.10", features = ["http1", "client", "client-legacy", "tokio"] }
123h2 = { version = "0.4", optional = true }
124once_cell = "1.18"
125log = "0.4.17"
126mime = "0.3.16"
127percent-encoding = "2.3"
128tokio = { version = "1.0", default-features = false, features = ["net", "time"] }
129tower = { version = "0.5.2", default-features = false, features = ["timeout", "util"] }
130pin-project-lite = "0.2.11"
131ipnet = "2.3"
132
133# Optional deps...
134rustls-pemfile = { version = "2", optional = true }
135
136## default-tls
137hyper-tls = { version = "0.6", optional = true }
138native-tls-crate = { version = "0.2.10", optional = true, package = "native-tls" }
139tokio-native-tls = { version = "0.3.0", optional = true }
140
141# rustls-tls
142hyper-rustls = { version = "0.27.0", default-features = false, optional = true, features = ["http1", "tls12"] }
143rustls = { version = "0.23.4", optional = true, default-features = false, features = ["std", "tls12"] }
144rustls-pki-types = { version = "1.1.0", features = ["alloc"] ,optional = true }
145tokio-rustls = { version = "0.26", optional = true, default-features = false, features = ["tls12"] }
146webpki-roots = { version = "0.26.0", optional = true }
147rustls-native-certs = { version = "0.8.0", optional = true }
148
149## cookies
150cookie_crate = { version = "0.18.0", package = "cookie", optional = true }
151cookie_store = { version = "0.21.0", optional = true }
152
153## compression
154async-compression = { version = "0.4.0", default-features = false, features = ["tokio"], optional = true }
155tokio-util = { version = "0.7.9", default-features = false, features = ["codec", "io"], optional = true }
156
157## socks
158tokio-socks = { version = "0.5.2", optional = true }
159
160## hickory-dns
161hickory-resolver = { version = "0.24", optional = true, features = ["tokio-runtime"] }
162
163# HTTP/3 experimental support
164h3 = { version = "0.0.7", optional = true }
165h3-quinn = { version = "0.0.9", optional = true }
166quinn = { version = "0.11.1", default-features = false, features = ["rustls", "runtime-tokio"], optional = true }
167slab = { version = "0.4.9", optional = true } # just to get minimal versions working with quinn
168futures-channel = { version = "0.3", optional = true }
169
170[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
171env_logger = "0.10"
172hyper = { version = "1.1.0", default-features = false, features = ["http1", "http2", "client", "server"] }
173hyper-util = { version = "0.1.10", features = ["http1", "http2", "client", "client-legacy", "server-auto", "tokio"] }
174serde = { version = "1.0", features = ["derive"] }
175libflate = "2.1"
176brotli_crate = { package = "brotli", version = "6.0.0" }
177zstd_crate = { package = "zstd", version = "0.13" }
178doc-comment = "0.3"
179tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread"] }
180futures-util = { version = "0.3.28", default-features = false, features = ["std", "alloc"] }
181rustls = { version = "0.23", default-features = false, features = ["ring"] }
182
183[target.'cfg(windows)'.dependencies]
184windows-registry = "0.4"
185
186[target.'cfg(target_os = "macos")'.dependencies]
187system-configuration = { version = "0.6.0", optional = true }
188
189# wasm
190
191[target.'cfg(target_arch = "wasm32")'.dependencies]
192js-sys = "0.3.77"
193serde_json = "1.0"
194wasm-bindgen = "0.2.89"
195wasm-bindgen-futures = "0.4.18"
196wasm-streams = { version = "0.4", optional = true }
197
198[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
199version = "0.3.28"
200features = [
201 "AbortController",
202 "AbortSignal",
203 "Headers",
204 "Request",
205 "RequestInit",
206 "RequestMode",
207 "Response",
208 "Window",
209 "FormData",
210 "Blob",
211 "BlobPropertyBag",
212 "ServiceWorkerGlobalScope",
213 "RequestCredentials",
214 "File",
215 "ReadableStream"
216]
217
218[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
219wasm-bindgen = { version = "0.2.89", features = ["serde-serialize"] }
220wasm-bindgen-test = "0.3"
221
222[dev-dependencies]
223tower = { version = "0.5.2", default-features = false, features = ["limit"] }
224num_cpus = "1.0"
225libc = "0"
226
227[lints.rust]
228unexpected_cfgs = { level = "warn", check-cfg = ['cfg(reqwest_unstable)'] }
229
230[[example]]
231name = "blocking"
232path = "examples/blocking.rs"
233required-features = ["blocking"]
234
235[[example]]
236name = "json_dynamic"
237path = "examples/json_dynamic.rs"
238required-features = ["json"]
239
240[[example]]
241name = "json_typed"
242path = "examples/json_typed.rs"
243required-features = ["json"]
244
245[[example]]
246name = "tor_socks"
247path = "examples/tor_socks.rs"
248required-features = ["socks"]
249
250[[example]]
251name = "form"
252path = "examples/form.rs"
253
254[[example]]
255name = "simple"
256path = "examples/simple.rs"
257
258[[example]]
259name = "h3_simple"
260path = "examples/h3_simple.rs"
261required-features = ["http3", "rustls-tls"]
262
263[[example]]
264name = "connect_via_lower_priority_tokio_runtime"
265path = "examples/connect_via_lower_priority_tokio_runtime.rs"
266
267[[test]]
268name = "blocking"
269path = "tests/blocking.rs"
270required-features = ["blocking"]
271
272[[test]]
273name = "cookie"
274path = "tests/cookie.rs"
275required-features = ["cookies"]
276
277[[test]]
278name = "gzip"
279path = "tests/gzip.rs"
280required-features = ["gzip", "stream"]
281
282[[test]]
283name = "brotli"
284path = "tests/brotli.rs"
285required-features = ["brotli", "stream"]
286
287[[test]]
288name = "zstd"
289path = "tests/zstd.rs"
290required-features = ["zstd", "stream"]
291
292[[test]]
293name = "deflate"
294path = "tests/deflate.rs"
295required-features = ["deflate", "stream"]
296
297[[test]]
298name = "multipart"
299path = "tests/multipart.rs"
300required-features = ["multipart"]
301