-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cargo.toml
153 lines (126 loc) · 3.65 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
[package]
name = "client-util"
version = "0.1.1"
edition = "2021"
authors = ["4t145<u4t145@163.com>"]
description = "Help you to build requests and handle responses by several extension trait!"
repository = "https://github.com/4t145/client-util"
license = "Apache-2.0"
keywords = ["http", "tower", "hyper", "client", "middleware"]
categories = ["asynchronous", "network-programming"]
readme = "README.md"
[dependencies]
# Http essentials
http = "1"
http-body-util = "0.1"
tower-service = "0.3"
http-body = "1"
bytes = "1.6"
mime = "0.3"
pin-project-lite = "0.2"
tower = { version = "0.4", features = ["util"] }
# Extension layer
tower-http = { version = "0.5", features = ["timeout"], optional = true }
# Hyper client
hyper = { version = "1.3", features = ["client"], optional = true }
hyper-util = { version = "0.1", features = [
"client",
"http1",
"http2",
"client-legacy",
], optional = true }
# TLS support
hyper-rustls = { version = "0.27", features = ["http2"], optional = true }
rustls = { version = "0.23", optional = true }
# Serde support
serde = { version = "1", optional = true }
# Json
serde_json = { version = "1", optional = true }
# Query
serde_urlencoded = { version = "0.7", optional = true }
# Auth
base64 = { version = "0.22", optional = true }
# Form
percent-encoding = { version = "2.3", optional = true }
# Stream
futures-core = { version = "0.3", optional = true }
futures-util = { version = "0.3", optional = true }
encoding_rs = { version = "0.8.34", optional = true }
opentelemetry-http = { version = "0.12.0", optional = true }
[features]
default = [
"rt-tokio",
"client-hyper",
"client-hyper-rustls",
"json",
"query",
"stream",
"decompression-deflate",
"decompression-gzip",
"decompression-br",
]
futures-util = ["dep:futures-util"]
futures-core = ["dep:futures-core"]
hyper-rustls = ["dep:hyper-rustls"]
rustls = ["dep:rustls"]
hyper = ["dep:hyper"]
hyper-util = ["dep:hyper-util"]
serde = ["dep:serde"]
serde_json = ["dep:serde_json", "serde"]
serde_urlencoded = ["dep:serde_urlencoded", "serde"]
base64 = ["dep:base64"]
client-hyper = ["hyper", "hyper-util"]
client-hyper-rustls = ["hyper-rustls", "rustls"]
encoding_rs = ["dep:encoding_rs"]
# Stream support
stream = ["futures-core", "futures-util"]
# json support
json = ["serde_json"]
# query support
query = ["serde_urlencoded"]
# multipart support
multipart = ["percent-encoding", "stream"]
# basic auth support
auth = ["base64"]
percent-encoding = ["dep:percent-encoding"]
form = ["serde_urlencoded"]
# decompression support
decompression-all = [
"decompression-deflate",
"decompression-gzip",
"decompression-br",
"decompression-zstd",
]
decompression-deflate = ["tower-http/decompression-deflate"]
decompression-gzip = ["tower-http/decompression-gzip"]
decompression-br = ["tower-http/decompression-br"]
decompression-zstd = ["tower-http/decompression-zstd"]
# charset decoding
charset = ["encoding_rs"]
# Runtime
rt-tokio = ["dep:tower-http"]
# full
full = ["client-hyper", "client-hyper-rustls", "form", "json", "query", "auth", "multipart"]
opentelemetry-http = ["dep:opentelemetry-http"]
[dev-dependencies]
tokio = { version = "1.38.0", features = ["full"] }
serde = { version = "1", features = ["derive"] }
hyper = { version = "1.3", features = ["server", "client"] }
hyper-util = { version = "0.1", features = [
"server",
"client",
"http1",
"http2",
"client-legacy",
] }
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[[example]]
name = "json"
path = "examples/json.rs"
required-features = ["json"]
[[example]]
name = "multipart"
path = "examples/multi_part.rs"
required-features = ["multipart"]