1 #ifndef WSJCPP_LIGHT_WEB_HTTP_RESPONSE_H 2 #define WSJCPP_LIGHT_WEB_HTTP_RESPONSE_H 28 void sendText(
const std::string &sBody);
29 void sendJson(
const nlohmann::json &json);
32 void sendFile(
const std::string &sFilePath);
33 void sendBuffer(
const std::string &sFilePath,
const char *pBuffer,
const int nBufferSize);
49 #endif // WSJCPP_LIGHT_WEB_HTTP_RESPONSE_H bool m_bClosed
Definition: wsjcpp_light_web_http_response.h:42
std::string m_sCacheControl
Definition: wsjcpp_light_web_http_response.h:45
WsjcppLightWebHttpResponse & requestTimeout()
Definition: wsjcpp_light_web_http_response.cpp:90
void sendFile(const std::string &sFilePath)
Definition: wsjcpp_light_web_http_response.cpp:223
std::string prepareHeaders(int nLength)
Definition: wsjcpp_light_web_http_response.cpp:111
std::string m_sDataType
Definition: wsjcpp_light_web_http_response.h:44
void sendEmpty()
Definition: wsjcpp_light_web_http_response.cpp:197
WsjcppLightWebHttpResponse & notFound()
Definition: wsjcpp_light_web_http_response.cpp:62
Definition: wsjcpp_light_web_http_response.h:10
WsjcppLightWebHttpResponse & noCache()
Definition: wsjcpp_light_web_http_response.cpp:97
int m_nSockFd
Definition: wsjcpp_light_web_http_response.h:41
WsjcppLightWebHttpResponse & internalServerError()
Definition: wsjcpp_light_web_http_response.cpp:76
WsjcppLightWebHttpResponse & cacheSec(int nCacheSec)
Definition: wsjcpp_light_web_http_response.cpp:104
void sendBuffer(const std::string &sFilePath, const char *pBuffer, const int nBufferSize)
Definition: wsjcpp_light_web_http_response.cpp:252
WsjcppLightWebHttpResponse(int nSockFd)
Definition: wsjcpp_light_web_http_response.cpp:16
std::string detectTypeOfFile(const std::string &sFilePath)
Definition: wsjcpp_light_web_http_response.cpp:126
WsjcppLightWebHttpResponse & ok()
Definition: wsjcpp_light_web_http_response.cpp:41
void sendText(const std::string &sBody)
Definition: wsjcpp_light_web_http_response.cpp:157
WsjcppLightWebHttpResponse & notImplemented()
Definition: wsjcpp_light_web_http_response.cpp:83
WsjcppLightWebHttpResponse & payloadTooLarge()
Definition: wsjcpp_light_web_http_response.cpp:69
WsjcppLightWebHttpResponse & forbidden()
Definition: wsjcpp_light_web_http_response.cpp:55
std::string TAG
Definition: wsjcpp_light_web_http_response.h:39
static std::map< int, std::string > * g_mapReponseDescription
Definition: wsjcpp_light_web_http_response.h:12
WsjcppLightWebHttpResponse & badRequest()
Definition: wsjcpp_light_web_http_response.cpp:48
void sendOptions(const std::string &sOptions)
Definition: wsjcpp_light_web_http_response.cpp:203
std::string m_sLastModified
Definition: wsjcpp_light_web_http_response.h:46
int m_nResponseCode
Definition: wsjcpp_light_web_http_response.h:43
void sendJson(const nlohmann::json &json)
Definition: wsjcpp_light_web_http_response.cpp:177