potato-macro

Crates.iopotato-macro
lib.rspotato-macro
version0.2.19
created_at2024-12-18 16:02:24.929872+00
updated_at2026-01-14 14:40:02.035126+00
descriptionA very simple and high performance http library.
homepagehttps://github.com/fawdlstty/potato
repositoryhttps://github.com/fawdlstty/potato
max_upload_size
id1488161
size24,817
Fawdlstty (fawdlstty)

documentation

README

potato

version status

English | 简体中文

High-performance, concise syntax HTTP framework.

Usage

Online Documentation

Add the library reference:

cargo add potato
cargo add tokio --features full

Hello Server

// 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;
}

Hello Client

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let res = potato::get("https://www.fawdlstty.com", vec![]).await?;
    println!("{}", String::from_utf8(res.body)?);
    Ok(())
}

More Examples

Please refer to: https://github.com/fawdlstty/potato/tree/main/examples

Commit count: 132

cargo fmt