| 12345678910111213 |
- #pragma once
- #include <httplib.h>
- #include <nlohmann/json.hpp>
- namespace svapi {
- // Parse a request body as JSON; throws ApiError(BadRequest) on failure.
- nlohmann::json bodyJson(const httplib::Request& req);
- // Serialize and send a JSON response with the given status.
- void sendJson(httplib::Response& res, int status, const nlohmann::json& body);
- } // namespace svapi
|