port to crafter.build v2

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-05-06 01:06:05 +02:00
commit 4e097d2b2d
8 changed files with 156 additions and 193 deletions

View file

@ -1,6 +1,6 @@
/*
Crafter® Build
Copyright (C) 2025 Catcrafts®
Copyright (C) 2026 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
@ -20,14 +20,12 @@ import Crafter.Network;
import std;
using namespace Crafter;
extern "C" {
std::string* RunTest() {
ClientHTTP client("httpbin.org", 80);
HTTPResponse response = client.Send(CreateRequestHTTP("GET", "/get", "httpbin.org"));
if(response.status == "200 OK") {
return nullptr;
} else {
return new std::string(response.body);
}
int main() {
ClientHTTP client("httpbin.org", 80);
HTTPResponse response = client.Send(CreateRequestHTTP("GET", "/get", "httpbin.org"));
if (response.status == "200 OK") {
return 0;
}
std::println("{}", response.body);
return 1;
}