# potato


高性能、简洁语法的HTTP框架。
# 用法
[在线文档](https://potato.fawdlstty.com)
加入库的引用:
```sh
cargo add potato
cargo add tokio --features full
```
### Hello Server
```rust
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;
}
```
### Hello Client
```rust
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let res = potato::get("https://www.fawdlstty.com", vec![]).await?;
println!("{}", String::from_utf8(res.body)?);
Ok(())
}
```
### 更多示例
请参考:<https://github.com/fawdlstty/potato/tree/main/examples>