14#include <nlohmann/json.hpp>
28void sendError(
HttpResponse& res,
int statusCode,
const std::string& code,
const std::string& message);
30 sendError(res, 404,
"not_found", message);
33 sendError(res, 400,
"bad_request", message);
36 sendError(res, 401,
"unauthorized", message);
Represents an HTTP response object.
void sendNotFound(HttpResponse &res, const std::string &message)
void sendMessage(HttpResponse &res, const std::string &message)
void sendBadRequest(HttpResponse &res, const std::string &message)
void sendUnauthorized(HttpResponse &res, const std::string &message)
void sendError(HttpResponse &res, int statusCode, const std::string &code, const std::string &message)
void sendNoContent(HttpResponse &res)
void sendSuccess(HttpResponse &res, const nlohmann::json &data, const std::string &message)
void sendJson(HttpResponse &res, const nlohmann::json &raw, int statusCode)
void sendCreated(HttpResponse &res, const nlohmann::json &data, const std::string &message)