Utility functions to send standard JSON responses using nlohmann::json. More...
#include <string>
#include <nlohmann/json.hpp>
Go to the source code of this file.
Namespaces | |
namespace | JsonResponse |
Functions | |
void | JsonResponse::sendSuccess (HttpResponse &res, const nlohmann::json &data, const std::string &message) |
void | JsonResponse::sendCreated (HttpResponse &res, const nlohmann::json &data, const std::string &message) |
void | JsonResponse::sendMessage (HttpResponse &res, const std::string &message) |
void | JsonResponse::sendNoContent (HttpResponse &res) |
void | JsonResponse::sendJson (HttpResponse &res, const nlohmann::json &raw, int statusCode) |
void | JsonResponse::sendError (HttpResponse &res, int statusCode, const std::string &code, const std::string &message) |
void | JsonResponse::sendNotFound (HttpResponse &res, const std::string &message) |
void | JsonResponse::sendBadRequest (HttpResponse &res, const std::string &message) |
void | JsonResponse::sendUnauthorized (HttpResponse &res, const std::string &message) |
Definition in file JsonResponse.h.