| Crates.io | potato-macro |
| lib.rs | potato-macro |
| version | 0.2.13 |
| created_at | 2024-12-18 16:02:24.929872+00 |
| updated_at | 2025-09-23 14:12:31.423146+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 | 1488161 |
| size | 24,739 |
高性能、简洁语法的HTTP框架。
加入库的引用:
cargo add potato
cargo add tokio --features full
use potato::*;
// http://127.0.0.1:8080/hello
#[http_get("/hello")]
async fn hello() -> HttpResponse {
HttpResponse::html("hello world")
}
#[tokio::main]
async fn main() {
let mut server = 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(())
}