【文件属性】:
文件名称:tengas:您需要的用于Rust的异步http客户端!
文件大小:4KB
文件格式:ZIP
更新时间:2021-05-19 15:05:58
Rust
天加斯
尝试使用兼容的异步http客户端。
该库使用Hyper处理HTTP消息的解析和序列化,并使用管理事件循环。
当前,客户端仅支持GET请求
例子
let mut client = Client :: new (). ok (). expect ( "unable to start client" );
let print_body = move | response: String | {
println! ( "{}" , response)
};
client. get ( "http://httpbin.org/get" , Box :: new (print_body));
// because we are asynchronous, we need to sleep a bit to wait for the
// callback to be reached
【文件预览】:
tengas-master
----src()
--------http.rs(2KB)
--------lib.rs(6KB)
----Cargo.toml(179B)
----.gitignore(18B)
----README.md(652B)