#http-request #request #http #winapi #send-http #no-std #windows

no-std http-req-no-std-win

一个库,允许您使用Windows API crate发送简单的HTTP请求,支持no_std!

1个不稳定版本

0.1.0 2024年8月7日

#1719网络编程

Download history 106/week @ 2024-08-05

每月 106 次下载

MIT 许可证

13KB
291

这个项目是关于什么的?

http_req_no_std_win 如其名所示,是一个兼容no_std的库,专为Windows制作,该项目的目标是使用no_std消除大型二进制文件大小,库保持相对简单。

示例用法

use http_req_no_std_win::request::{ClientBuilder, Request, RequestType};

fn main() {
    let body = r#"{"name":"morpheus","job":"jobless"}"#.as_bytes().to_vec();
    
    let client_builder = ClientBuilder::new()
        .url("https://reqres.in/api/users/2")
        .request_type(RequestType::GET)
        //.body(body)
        .build();
    
    let request = Request { client: client_builder };

    match request.send() {
        Ok(response) => println!("Response: {:?}", response),
        Err(error) => println!("Request failed with error code: {:?}", error),
    }
}

依赖项

~225KB