1 | [package] |
2 | name = "reqwest" |
3 | version = "0.12.15" |
4 | description = "higher level HTTP client library" |
5 | keywords = ["http" , "request" , "client" ] |
6 | categories = ["web-programming::http-client" , "wasm" ] |
7 | repository = "https://github.com/seanmonstar/reqwest" |
8 | documentation = "https://docs.rs/reqwest" |
9 | authors = ["Sean McArthur <sean@seanmonstar.com>" ] |
10 | readme = "README.md" |
11 | license = "MIT OR Apache-2.0" |
12 | edition = "2021" |
13 | rust-version = "1.64.0" |
14 | autotests = true |
15 | |
16 | [package.metadata.docs.rs] |
17 | all-features = true |
18 | rustdoc-args = ["--cfg" , "docsrs" , "--cfg" , "reqwest_unstable" ] |
19 | targets = ["x86_64-unknown-linux-gnu" , "wasm32-unknown-unknown" ] |
20 | |
21 | [package.metadata.playground] |
22 | features = [ |
23 | "blocking" , |
24 | "cookies" , |
25 | "json" , |
26 | "multipart" , |
27 | ] |
28 | |
29 | [features] |
30 | default = ["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. |
34 | default-tls = ["dep:hyper-tls" , "dep:native-tls-crate" , "__tls" , "dep:tokio-native-tls" ] |
35 | |
36 | http2 = ["h2" , "hyper/http2" , "hyper-util/http2" , "hyper-rustls?/http2" ] |
37 | |
38 | # Enables native-tls specific functionality not available by default. |
39 | native-tls = ["default-tls" ] |
40 | native-tls-alpn = ["native-tls" , "native-tls-crate?/alpn" , "hyper-tls?/alpn" ] |
41 | native-tls-vendored = ["native-tls" , "native-tls-crate?/vendored" ] |
42 | |
43 | rustls-tls = ["rustls-tls-webpki-roots" ] |
44 | rustls-tls-no-provider = ["rustls-tls-manual-roots-no-provider" ] |
45 | |
46 | rustls-tls-manual-roots-no-provider = ["__rustls" ] |
47 | rustls-tls-webpki-roots-no-provider = ["dep:webpki-roots" , "hyper-rustls?/webpki-tokio" , "__rustls" ] |
48 | rustls-tls-native-roots-no-provider = ["dep:rustls-native-certs" , "hyper-rustls?/native-tokio" , "__rustls" ] |
49 | |
50 | rustls-tls-manual-roots = ["rustls-tls-manual-roots-no-provider" , "__rustls-ring" ] |
51 | rustls-tls-webpki-roots = ["rustls-tls-webpki-roots-no-provider" , "__rustls-ring" ] |
52 | rustls-tls-native-roots = ["rustls-tls-native-roots-no-provider" , "__rustls-ring" ] |
53 | |
54 | blocking = ["dep:futures-channel" , "futures-channel?/sink" , "futures-util/io" , "futures-util/sink" , "tokio/sync" ] |
55 | |
56 | charset = ["dep:encoding_rs" ] |
57 | |
58 | cookies = ["dep:cookie_crate" , "dep:cookie_store" ] |
59 | |
60 | gzip = ["dep:async-compression" , "async-compression?/gzip" , "dep:tokio-util" ] |
61 | |
62 | brotli = ["dep:async-compression" , "async-compression?/brotli" , "dep:tokio-util" ] |
63 | |
64 | zstd = ["dep:async-compression" , "async-compression?/zstd" , "dep:tokio-util" ] |
65 | |
66 | deflate = ["dep:async-compression" , "async-compression?/zlib" , "dep:tokio-util" ] |
67 | |
68 | json = ["dep:serde_json" ] |
69 | |
70 | multipart = ["dep:mime_guess" ] |
71 | |
72 | # Deprecated, remove this feature while bumping minor versions. |
73 | trust-dns = [] |
74 | hickory-dns = ["dep:hickory-resolver" ] |
75 | |
76 | stream = ["tokio/fs" , "dep:tokio-util" , "dep:wasm-streams" ] |
77 | |
78 | socks = ["dep:tokio-socks" ] |
79 | |
80 | # Use the system's proxy configuration. |
81 | macos-system-configuration = ["dep:system-configuration" ] |
82 | |
83 | # Experimental HTTP/3 client. |
84 | http3 = ["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] |
99 | base64 = "0.22" |
100 | http = "1" |
101 | url = "2.4" |
102 | bytes = "1.2" |
103 | serde = "1.0" |
104 | serde_urlencoded = "0.7.1" |
105 | tower-service = "0.3" |
106 | futures-core = { version = "0.3.28" , default-features = false } |
107 | futures-util = { version = "0.3.28" , default-features = false } |
108 | sync_wrapper = { version = "1.0" , features = ["futures" ] } |
109 | |
110 | # Optional deps... |
111 | |
112 | ## json |
113 | serde_json = { version = "1.0" , optional = true } |
114 | ## multipart |
115 | mime_guess = { version = "2.0" , default-features = false, optional = true } |
116 | |
117 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] |
118 | encoding_rs = { version = "0.8" , optional = true } |
119 | http-body = "1" |
120 | http-body-util = "0.1" |
121 | hyper = { version = "1.1" , features = ["http1" , "client" ] } |
122 | hyper-util = { version = "0.1.10" , features = ["http1" , "client" , "client-legacy" , "tokio" ] } |
123 | h2 = { version = "0.4" , optional = true } |
124 | once_cell = "1.18" |
125 | log = "0.4.17" |
126 | mime = "0.3.16" |
127 | percent-encoding = "2.3" |
128 | tokio = { version = "1.0" , default-features = false, features = ["net" , "time" ] } |
129 | tower = { version = "0.5.2" , default-features = false, features = ["timeout" , "util" ] } |
130 | pin-project-lite = "0.2.11" |
131 | ipnet = "2.3" |
132 | |
133 | # Optional deps... |
134 | rustls-pemfile = { version = "2" , optional = true } |
135 | |
136 | ## default-tls |
137 | hyper-tls = { version = "0.6" , optional = true } |
138 | native-tls-crate = { version = "0.2.10" , optional = true, package = "native-tls" } |
139 | tokio-native-tls = { version = "0.3.0" , optional = true } |
140 | |
141 | # rustls-tls |
142 | hyper-rustls = { version = "0.27.0" , default-features = false, optional = true, features = ["http1" , "tls12" ] } |
143 | rustls = { version = "0.23.4" , optional = true, default-features = false, features = ["std" , "tls12" ] } |
144 | rustls-pki-types = { version = "1.1.0" , features = ["alloc" ] ,optional = true } |
145 | tokio-rustls = { version = "0.26" , optional = true, default-features = false, features = ["tls12" ] } |
146 | webpki-roots = { version = "0.26.0" , optional = true } |
147 | rustls-native-certs = { version = "0.8.0" , optional = true } |
148 | |
149 | ## cookies |
150 | cookie_crate = { version = "0.18.0" , package = "cookie" , optional = true } |
151 | cookie_store = { version = "0.21.0" , optional = true } |
152 | |
153 | ## compression |
154 | async-compression = { version = "0.4.0" , default-features = false, features = ["tokio" ], optional = true } |
155 | tokio-util = { version = "0.7.9" , default-features = false, features = ["codec" , "io" ], optional = true } |
156 | |
157 | ## socks |
158 | tokio-socks = { version = "0.5.2" , optional = true } |
159 | |
160 | ## hickory-dns |
161 | hickory-resolver = { version = "0.24" , optional = true, features = ["tokio-runtime" ] } |
162 | |
163 | # HTTP/3 experimental support |
164 | h3 = { version = "0.0.7" , optional = true } |
165 | h3-quinn = { version = "0.0.9" , optional = true } |
166 | quinn = { version = "0.11.1" , default-features = false, features = ["rustls" , "runtime-tokio" ], optional = true } |
167 | slab = { version = "0.4.9" , optional = true } # just to get minimal versions working with quinn |
168 | futures-channel = { version = "0.3" , optional = true } |
169 | |
170 | [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] |
171 | env_logger = "0.10" |
172 | hyper = { version = "1.1.0" , default-features = false, features = ["http1" , "http2" , "client" , "server" ] } |
173 | hyper-util = { version = "0.1.10" , features = ["http1" , "http2" , "client" , "client-legacy" , "server-auto" , "tokio" ] } |
174 | serde = { version = "1.0" , features = ["derive" ] } |
175 | libflate = "2.1" |
176 | brotli_crate = { package = "brotli" , version = "6.0.0" } |
177 | zstd_crate = { package = "zstd" , version = "0.13" } |
178 | doc-comment = "0.3" |
179 | tokio = { version = "1.0" , default-features = false, features = ["macros" , "rt-multi-thread" ] } |
180 | futures-util = { version = "0.3.28" , default-features = false, features = ["std" , "alloc" ] } |
181 | rustls = { version = "0.23" , default-features = false, features = ["ring" ] } |
182 | |
183 | [target.'cfg(windows)'.dependencies] |
184 | windows-registry = "0.4" |
185 | |
186 | [target.'cfg(target_os = "macos")'.dependencies] |
187 | system-configuration = { version = "0.6.0" , optional = true } |
188 | |
189 | # wasm |
190 | |
191 | [target.'cfg(target_arch = "wasm32")'.dependencies] |
192 | js-sys = "0.3.77" |
193 | serde_json = "1.0" |
194 | wasm-bindgen = "0.2.89" |
195 | wasm-bindgen-futures = "0.4.18" |
196 | wasm-streams = { version = "0.4" , optional = true } |
197 | |
198 | [target.'cfg(target_arch = "wasm32")'.dependencies.web-sys] |
199 | version = "0.3.28" |
200 | features = [ |
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] |
219 | wasm-bindgen = { version = "0.2.89" , features = ["serde-serialize" ] } |
220 | wasm-bindgen-test = "0.3" |
221 | |
222 | [dev-dependencies] |
223 | tower = { version = "0.5.2" , default-features = false, features = ["limit" ] } |
224 | num_cpus = "1.0" |
225 | libc = "0" |
226 | |
227 | [lints.rust] |
228 | unexpected_cfgs = { level = "warn" , check-cfg = ['cfg(reqwest_unstable)' ] } |
229 | |
230 | [[example]] |
231 | name = "blocking" |
232 | path = "examples/blocking.rs" |
233 | required-features = ["blocking" ] |
234 | |
235 | [[example]] |
236 | name = "json_dynamic" |
237 | path = "examples/json_dynamic.rs" |
238 | required-features = ["json" ] |
239 | |
240 | [[example]] |
241 | name = "json_typed" |
242 | path = "examples/json_typed.rs" |
243 | required-features = ["json" ] |
244 | |
245 | [[example]] |
246 | name = "tor_socks" |
247 | path = "examples/tor_socks.rs" |
248 | required-features = ["socks" ] |
249 | |
250 | [[example]] |
251 | name = "form" |
252 | path = "examples/form.rs" |
253 | |
254 | [[example]] |
255 | name = "simple" |
256 | path = "examples/simple.rs" |
257 | |
258 | [[example]] |
259 | name = "h3_simple" |
260 | path = "examples/h3_simple.rs" |
261 | required-features = ["http3" , "rustls-tls" ] |
262 | |
263 | [[example]] |
264 | name = "connect_via_lower_priority_tokio_runtime" |
265 | path = "examples/connect_via_lower_priority_tokio_runtime.rs" |
266 | |
267 | [[test]] |
268 | name = "blocking" |
269 | path = "tests/blocking.rs" |
270 | required-features = ["blocking" ] |
271 | |
272 | [[test]] |
273 | name = "cookie" |
274 | path = "tests/cookie.rs" |
275 | required-features = ["cookies" ] |
276 | |
277 | [[test]] |
278 | name = "gzip" |
279 | path = "tests/gzip.rs" |
280 | required-features = ["gzip" , "stream" ] |
281 | |
282 | [[test]] |
283 | name = "brotli" |
284 | path = "tests/brotli.rs" |
285 | required-features = ["brotli" , "stream" ] |
286 | |
287 | [[test]] |
288 | name = "zstd" |
289 | path = "tests/zstd.rs" |
290 | required-features = ["zstd" , "stream" ] |
291 | |
292 | [[test]] |
293 | name = "deflate" |
294 | path = "tests/deflate.rs" |
295 | required-features = ["deflate" , "stream" ] |
296 | |
297 | [[test]] |
298 | name = "multipart" |
299 | path = "tests/multipart.rs" |
300 | required-features = ["multipart" ] |
301 | |