1 | [package] |
2 | name = "reqwest" |
3 | version = "0.11.27" # remember to update html_root_url |
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.63.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" ] |
31 | |
32 | # Note: this doesn't enable the 'native-tls' feature, which adds specific |
33 | # functionality for it. |
34 | default-tls = ["hyper-tls" , "native-tls-crate" , "__tls" , "tokio-native-tls" ] |
35 | |
36 | # Enables native-tls specific functionality not available by default. |
37 | native-tls = ["default-tls" ] |
38 | native-tls-alpn = ["native-tls" , "native-tls-crate/alpn" ] |
39 | native-tls-vendored = ["native-tls" , "native-tls-crate/vendored" ] |
40 | |
41 | rustls-tls = ["rustls-tls-webpki-roots" ] |
42 | rustls-tls-manual-roots = ["__rustls" ] |
43 | rustls-tls-webpki-roots = ["webpki-roots" , "__rustls" ] |
44 | rustls-tls-native-roots = ["rustls-native-certs" , "__rustls" ] |
45 | |
46 | blocking = ["futures-util/io" , "tokio/sync" ] |
47 | |
48 | cookies = ["cookie_crate" , "cookie_store" ] |
49 | |
50 | gzip = ["async-compression" , "async-compression/gzip" , "tokio-util" ] |
51 | |
52 | brotli = ["async-compression" , "async-compression/brotli" , "tokio-util" ] |
53 | |
54 | deflate = ["async-compression" , "async-compression/zlib" , "tokio-util" ] |
55 | |
56 | json = ["serde_json" ] |
57 | |
58 | multipart = ["mime_guess" ] |
59 | |
60 | # Deprecated, remove this feature while bumping minor versions. |
61 | trust-dns = ["hickory-dns" ] |
62 | hickory-dns = ["hickory-resolver" ] |
63 | |
64 | stream = ["tokio/fs" , "tokio-util" , "wasm-streams" ] |
65 | |
66 | socks = ["tokio-socks" ] |
67 | |
68 | # Experimental HTTP/3 client. |
69 | http3 = ["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] |
85 | base64 = "0.21" |
86 | http = "0.2" |
87 | url = "2.2" |
88 | bytes = "1.0" |
89 | serde = "1.0" |
90 | serde_urlencoded = "0.7.1" |
91 | tower-service = "0.3" |
92 | futures-core = { version = "0.3.0" , default-features = false } |
93 | futures-util = { version = "0.3.0" , default-features = false } |
94 | sync_wrapper = "0.1.2" |
95 | |
96 | # Optional deps... |
97 | |
98 | ## json |
99 | serde_json = { version = "1.0" , optional = true } |
100 | ## multipart |
101 | mime_guess = { version = "2.0" , default-features = false, optional = true } |
102 | |
103 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] |
104 | encoding_rs = "0.8" |
105 | http-body = "0.4.0" |
106 | hyper = { version = "0.14.21" , default-features = false, features = ["tcp" , "http1" , "http2" , "client" , "runtime" ] } |
107 | h2 = "0.3.14" |
108 | once_cell = "1" |
109 | log = "0.4" |
110 | mime = "0.3.16" |
111 | percent-encoding = "2.1" |
112 | tokio = { version = "1.0" , default-features = false, features = ["net" , "time" ] } |
113 | pin-project-lite = "0.2.0" |
114 | ipnet = "2.3" |
115 | |
116 | # Optional deps... |
117 | rustls-pemfile = { version = "1.0" , optional = true } |
118 | |
119 | ## default-tls |
120 | hyper-tls = { version = "0.5" , optional = true } |
121 | native-tls-crate = { version = "0.2.10" , optional = true, package = "native-tls" } |
122 | tokio-native-tls = { version = "0.3.0" , optional = true } |
123 | |
124 | # rustls-tls |
125 | hyper-rustls = { version = "0.24.0" , default-features = false, optional = true } |
126 | rustls = { version = "0.21.6" , features = ["dangerous_configuration" ], optional = true } |
127 | tokio-rustls = { version = "0.24" , optional = true } |
128 | webpki-roots = { version = "0.25" , optional = true } |
129 | rustls-native-certs = { version = "0.6" , optional = true } |
130 | |
131 | ## cookies |
132 | cookie_crate = { version = "0.17.0" , package = "cookie" , optional = true } |
133 | cookie_store = { version = "0.20.0" , optional = true } |
134 | |
135 | ## compression |
136 | async-compression = { version = "0.4.0" , default-features = false, features = ["tokio" ], optional = true } |
137 | tokio-util = { version = "0.7.1" , default-features = false, features = ["codec" , "io" ], optional = true } |
138 | |
139 | ## socks |
140 | tokio-socks = { version = "0.5.1" , optional = true } |
141 | |
142 | ## hickory-dns |
143 | hickory-resolver = { version = "0.24" , optional = true, features = ["tokio-runtime" ] } |
144 | |
145 | # HTTP/3 experimental support |
146 | h3 = { version = "0.0.3" , optional = true } |
147 | h3-quinn = { version = "0.0.4" , optional = true } |
148 | quinn = { version = "0.10" , default-features = false, features = ["tls-rustls" , "ring" , "runtime-tokio" ], optional = true } |
149 | futures-channel = { version = "0.3" , optional = true } |
150 | |
151 | |
152 | [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] |
153 | env_logger = "0.10" |
154 | hyper = { version = "0.14" , default-features = false, features = ["tcp" , "stream" , "http1" , "http2" , "client" , "server" , "runtime" ] } |
155 | serde = { version = "1.0" , features = ["derive" ] } |
156 | libflate = "1.0" |
157 | brotli_crate = { package = "brotli" , version = "3.3.0" } |
158 | doc-comment = "0.3" |
159 | tokio = { version = "1.0" , default-features = false, features = ["macros" , "rt-multi-thread" ] } |
160 | futures-util = { version = "0.3.0" , default-features = false, features = ["std" , "alloc" ] } |
161 | |
162 | [target.'cfg(windows)'.dependencies] |
163 | winreg = "0.50.0" |
164 | |
165 | [target.'cfg(target_os = "macos")'.dependencies] |
166 | system-configuration = "0.5.1" |
167 | |
168 | # wasm |
169 | |
170 | [target.'cfg(target_arch = "wasm32")'.dependencies] |
171 | js-sys = "0.3.45" |
172 | serde_json = "1.0" |
173 | wasm-bindgen = "0.2.68" |
174 | wasm-bindgen-futures = "0.4.18" |
175 | wasm-streams = { version = "0.4" , optional = true } |
176 | |
177 | [target.'cfg(target_arch = "wasm32")'.dependencies.web-sys] |
178 | version = "0.3.25" |
179 | features = [ |
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] |
198 | wasm-bindgen = { version = "0.2.68" , features = ["serde-serialize" ] } |
199 | wasm-bindgen-test = "0.3" |
200 | |
201 | [[example]] |
202 | name = "blocking" |
203 | path = "examples/blocking.rs" |
204 | required-features = ["blocking" ] |
205 | |
206 | [[example]] |
207 | name = "json_dynamic" |
208 | path = "examples/json_dynamic.rs" |
209 | required-features = ["json" ] |
210 | |
211 | [[example]] |
212 | name = "json_typed" |
213 | path = "examples/json_typed.rs" |
214 | required-features = ["json" ] |
215 | |
216 | [[example]] |
217 | name = "tor_socks" |
218 | path = "examples/tor_socks.rs" |
219 | required-features = ["socks" ] |
220 | |
221 | [[example]] |
222 | name = "form" |
223 | path = "examples/form.rs" |
224 | |
225 | [[example]] |
226 | name = "simple" |
227 | path = "examples/simple.rs" |
228 | |
229 | [[test]] |
230 | name = "blocking" |
231 | path = "tests/blocking.rs" |
232 | required-features = ["blocking" ] |
233 | |
234 | [[test]] |
235 | name = "cookie" |
236 | path = "tests/cookie.rs" |
237 | required-features = ["cookies" ] |
238 | |
239 | [[test]] |
240 | name = "gzip" |
241 | path = "tests/gzip.rs" |
242 | required-features = ["gzip" ] |
243 | |
244 | [[test]] |
245 | name = "brotli" |
246 | path = "tests/brotli.rs" |
247 | required-features = ["brotli" ] |
248 | |
249 | [[test]] |
250 | name = "deflate" |
251 | path = "tests/deflate.rs" |
252 | required-features = ["deflate" ] |
253 | |
254 | [[test]] |
255 | name = "multipart" |
256 | path = "tests/multipart.rs" |
257 | required-features = ["multipart" ] |
258 | |