Crates.io | smolhttp |
lib.rs | smolhttp |
version | 1.1.0 |
source | src |
created_at | 2022-03-14 11:41:26.329773 |
updated_at | 2022-03-14 13:29:00.779223 |
description | smolhttp is a fork of the original minihttp and aims to keep simple and lightweight |
homepage | https://github.com/FallAngel1337/smolhttp |
repository | https://github.com/FallAngel1337/smolhttp |
max_upload_size | |
id | 549786 |
size | 17,523 |
This project is a fork of the original minihttp
that tries to improve the code and add more features, dont pushing aside the main purpose of the project thats is to be simple and lightweight
.
All the credits go to the original author p00s
// Using the shortcut function
let content = smolhttp::get("https://www.rust-lang.org").unwrap().text();
println!("{content}");
// Using the Client
let content = smolhttp::Client::new("https://www.rust-lang.org").unwrap().get().send().unwrap().text();
println!("{content}");
// Using the shortcut funtion
let content = smolhttp::post("https://www.rust-lang.org").unwrap().text();
println!("{content}");
// Using the Client
let content = smolhttp::Client::new("https://www.rust-lang.org")
.unwrap()
.post()
.send()
.unwrap()
.text();
println!("{content}");
let content = smolhttp::Client::new("https://www.rust-lang.org")
.unwrap()
.post()
.headers(vec![("User-Agent".to_owned(), "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36".to_owned())])
.send()
.unwrap()
.text();
println!("{content}");
let content = smolhttp::Client::new("http://www.google.com")
.unwrap()
.proxy("http://127.0.0.1:1080")
.unwrap()
.get()
.send()
.unwrap()
.text();
println!("{content}");
[dependencies]
smolhttp = "1.0"