Init commit

This commit is contained in:
2026-08-17 06:31:43 +09:00
commit 348d9275f6
428 changed files with 61806 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "zcurl.h"
#include <iostream>
namespace ZCURL{
int test() {
try {
ZCURL::RequestOptions opt;
opt.query_params = {{"q", "C++20 libcurl"}};
opt.headers = {"Accept: application/json"};
opt.timeout_ms = 10000;
opt.http_version = ZCURL::HttpVersion::V2TLS;
auto res = ZCURL::get("https://httpbin.org/get", opt);
std::cout << "curl: " << ZCURL::version() << "\n";
std::cout << "status: " << res.status_code << "\n";
std::cout << "ok: " << res.ok() << "\n";
std::cout << res.body.substr(0, 300) << "\n";
return 0;
} catch (const std::exception &e) {
std::cerr << "error: " << e.what() << "\n";
return 1;
}
}
}