Skip to content

Commit

Permalink
feat:add key
Browse files Browse the repository at this point in the history
  • Loading branch information
ltpp-universe committed Dec 29, 2024
1 parent aa034c3 commit f9d5f91
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 37 deletions.
61 changes: 44 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "http-request"
version = "8.2.0"
version = "8.4.0"
edition = "2021"
authors = ["ltpp-universe <[email protected]>"]
license = "MIT"
Expand All @@ -20,16 +20,16 @@ brotli = "7.0.0"
flate2 = "1.0.35"
hex = "0.4.3"
http-compress = "1.0.0"
http-constant = "1.9.0"
http-type = "1.6.0"
http-constant = "1.13.0"
http-type = "2.0.12"
native-tls = "0.2.12"
serde = { version = "1.0", features = ["derive"] }
serde = { version = "1.0.217", features = ["derive"] }
serde-xml-rs = "0.6.0"
serde_json = "1.0.133"
serde_urlencoded = "0.7.1"
url = "2.5.4"
urlencoding = "2.1.3"

[dev-dependencies]
color-output = "4.1.2"
std-macro-extensions = "0.17.1"
color-output = "6.1.3"
std-macro-extensions = "0.17.6"
30 changes: 17 additions & 13 deletions src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ use std_macro_extensions::*;

#[allow(dead_code)]
fn output(title: &str, msg: &str, color: Color) {
OutputBuilder::new()
.show_time(true)
.time_bg_color(ColorType::Use(Color::Cyan))
.time_text_blod(true)
.split_text(title)
.split_text_blod(true)
.split_bg_color(ColorType::Use(Color::Yellow))
.text(msg)
.text_bg_color(ColorType::Use(color))
.text_blod(true)
.endl(true)
.build()
.output();
OutputListBuilder::new()
.add(
OutputBuilder::new()
.text(title)
.bg_color(ColorType::Use(Color::Cyan))
.blod(true)
.build(),
)
.add(
OutputBuilder::new()
.text(msg)
.bg_color(ColorType::Use(color))
.blod(true)
.endl(true)
.build(),
)
.run();
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/request/request/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl HttpRequest {
&self.get_body_bytes().len().to_string()
},
),
(ACCEPT, ACCEPT_VALUE),
(ACCEPT, ACCEPT_ANY),
(USER_AGENT, APP_NAME),
];
for &(key, default_value) in &required_headers {
Expand Down

0 comments on commit f9d5f91

Please sign in to comment.