Functions | |
void | sendSuccess (HttpResponse &res, const nlohmann::json &data, const std::string &message) |
void | sendCreated (HttpResponse &res, const nlohmann::json &data, const std::string &message) |
void | sendMessage (HttpResponse &res, const std::string &message) |
void | sendNoContent (HttpResponse &res) |
void | sendJson (HttpResponse &res, const nlohmann::json &raw, int statusCode) |
void | sendError (HttpResponse &res, int statusCode, const std::string &code, const std::string &message) |
void | sendNotFound (HttpResponse &res, const std::string &message) |
void | sendBadRequest (HttpResponse &res, const std::string &message) |
void | sendUnauthorized (HttpResponse &res, const std::string &message) |
|
inline |
Definition at line 32 of file JsonResponse.h.
References sendError().
void JsonResponse::sendCreated | ( | HttpResponse & | res, |
const nlohmann::json & | data, | ||
const std::string & | message | ||
) |
Definition at line 30 of file JsonResponse.cpp.
References HttpResponse::json(), and HttpResponse::status().
Referenced by HttpResponse::sendCreated().
void JsonResponse::sendError | ( | HttpResponse & | res, |
int | statusCode, | ||
const std::string & | code, | ||
const std::string & | message | ||
) |
Definition at line 52 of file JsonResponse.cpp.
References HttpResponse::json(), and HttpResponse::status().
Referenced by HttpServer::handleClient(), sendBadRequest(), HttpResponse::sendError(), HttpResponse::sendError(), sendNotFound(), sendUnauthorized(), and FileHandler::serveFile().
void JsonResponse::sendJson | ( | HttpResponse & | res, |
const nlohmann::json & | raw, | ||
int | statusCode | ||
) |
Definition at line 48 of file JsonResponse.cpp.
References HttpResponse::json(), and HttpResponse::status().
void JsonResponse::sendMessage | ( | HttpResponse & | res, |
const std::string & | message | ||
) |
Definition at line 37 of file JsonResponse.cpp.
References HttpResponse::json(), and HttpResponse::status().
Referenced by HttpResponse::sendMessage().
void JsonResponse::sendNoContent | ( | HttpResponse & | res | ) |
Definition at line 44 of file JsonResponse.cpp.
References HttpResponse::send(), and HttpResponse::status().
Referenced by GpioController::handleGetMultipleGpios(), and HttpResponse::sendNoContent().
|
inline |
Definition at line 29 of file JsonResponse.h.
References sendError().
void JsonResponse::sendSuccess | ( | HttpResponse & | res, |
const nlohmann::json & | data, | ||
const std::string & | message | ||
) |
Definition at line 23 of file JsonResponse.cpp.
References HttpResponse::json(), and HttpResponse::status().
Referenced by HttpResponse::sendSuccess().
|
inline |
Definition at line 35 of file JsonResponse.h.
References sendError().