Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
JsonResponse.h File Reference

Utility functions to send standard JSON responses using nlohmann::json. More...

#include <string>
#include <nlohmann/json.hpp>
+ Include dependency graph for JsonResponse.h:
+ This graph shows which files directly or indirectly include this file:

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)
 

Detailed Description

Author
Ian Archbell
Version
0.1
Date
2025-04-04
License:\n MIT

Definition in file JsonResponse.h.