update:http&&md5

This commit is contained in:
2025-09-08 15:12:25 +08:00
parent d5250fff74
commit d32f0e9f90
6 changed files with 354 additions and 26 deletions

View File

@@ -108,3 +108,21 @@ auto s = req.getStats();
说明:
- 若使用 HTTPS需在编译时添加 `-DCPPHTTPLIB_OPENSSL_SUPPORT` 并链接 `-lssl -lcrypto`,且将 `opt.scheme` 设为 `"https"`、端口通常为 `443`
- `base_path` 与各函数传入的 `path` 会自动合并,例如 `base_path="/api"``Get("/info")` 实际请求路径为 `/api/info`
7) 快速用法(无需实例化)
```cpp
using ntq::NetRequest;
// 直接传完整 URL 发起 GET
auto g = NetRequest::QuickGet("http://127.0.0.1:8080/api/info");
// 直接传完整 URL 发起 POST(JSON)
auto p1 = NetRequest::QuickPostJson(
"http://127.0.0.1:8080/api/set",
R"({"name":"orangepi","mode":"demo"})"
);
// 直接传完整 URL 发起 POST(表单)
httplib::Params form = {{"user","abc"},{"pwd","123"}};
auto p2 = NetRequest::QuickPostForm("http://127.0.0.1:8080/login", form);
```