| Crates.io | potato |
| lib.rs | potato |
| version | 0.2.21 |
| created_at | 2024-12-18 16:03:30.196417+00 |
| updated_at | 2026-01-22 15:33:24.387941+00 |
| description | A very simple and high performance http library. |
| homepage | https://github.com/fawdlstty/potato |
| repository | https://github.com/fawdlstty/potato |
| max_upload_size | |
| id | 1488166 |
| size | 11,429,134 |
English | 简体中文
High-performance, concise syntax HTTP framework.
Add the library reference:
cargo add potato
cargo add tokio --features full
// http://127.0.0.1:8080/hello
#[http_get("/hello")]
async fn hello() -> potato::HttpResponse {
potato::HttpResponse::html("hello world")
}
#[tokio::main]
async fn main() {
let mut server = potato::HttpServer::new("0.0.0.0:8080");
_ = server.serve_http().await;
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let res = potato::get("https://www.fawdlstty.com", vec![]).await?;
println!("{}", String::from_utf8(res.body)?);
Ok(())
}
Please refer to: https://github.com/fawdlstty/potato/tree/main/examples