Files
fn_registry/cpp/vendor/nlohmann/VENDORING.md
T
egutierrez 1cdbe1bcd1 feat(cpp/core): add http_request + http_get_json helpers (issue 0110)
Promotes the inline curl-popen pattern duplicated across apps/services_monitor,
dag_engine_ui, data_factory into two reusable functions in cpp/functions/core/:

- http_request_cpp_core: generic HTTP client (GET/POST/PUT/DELETE/PATCH) via
  cURL CLI through popen. Portable Linux/WSL/MinGW (no link-time libcurl).
  Supports custom headers, raw body, Bearer/Basic auth shortcuts, timeout,
  optional TLS verify skip. Returns status/body/headers/error/duration_ms.

- http_get_json_cpp_core: convenience wrapper over http_request — GET <url>,
  expect 2xx, parse body as nlohmann::json. Throws std::runtime_error on
  transport / non-2xx / parse failure.

Vendors nlohmann/json v3.11.3 single header at cpp/vendor/nlohmann/json.hpp
(MIT). No CMake target needed — header-only; consumers add
cpp/vendor/ to include path.
2026-05-18 18:14:37 +02:00

24 lines
837 B
Markdown

# nlohmann/json
Single-header JSON library. Vendored for `cpp/functions/core/http_get_json` and
future C++ functions that need JSON serialization without an extra dependency.
- **Source**: https://github.com/nlohmann/json
- **Version**: v3.11.3
- **File**: `json.hpp` (amalgamated single header)
- **License**: MIT
- **Download**: `curl -L -o json.hpp https://github.com/nlohmann/json/releases/download/v3.11.3/json.hpp`
Include with:
```cpp
#include "nlohmann/json.hpp"
using json = nlohmann::json;
```
Include path: `cpp/vendor/` (so `nlohmann/json.hpp` resolves). Tests +
`fn_framework` already have `cpp/vendor/` on the include search path via the
top-level `cpp/CMakeLists.txt` (`vendor/nlohmann` is header-only so it does
NOT need a CMake target — just `target_include_directories(<t> PRIVATE
${CMAKE_SOURCE_DIR}/vendor)`).