mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
add httpGet error handling
This commit is contained in:
parent
d7389c2220
commit
4328c83c79
3 changed files with 36 additions and 11 deletions
|
|
@ -9,9 +9,12 @@ TEST(curltest, curltest) {
|
|||
network->httpGet(
|
||||
"https://raw.githubusercontent.com/MihailRis/VoxelEngine-Cpp/refs/"
|
||||
"heads/curl/res/content/base/blocks/lamp.json",
|
||||
[=](int code, std::vector<char> data) {
|
||||
auto v = std::string_view(data.data(), data.size());
|
||||
auto value = json::parse(v);
|
||||
[](std::vector<char> data) {
|
||||
if (data.empty()) {
|
||||
return;
|
||||
}
|
||||
auto view = std::string_view(data.data(), data.size());
|
||||
auto value = json::parse(view);
|
||||
std::cout << value << std::endl;
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue