24#ifndef NAWA_RESPONSE_H
25#define NAWA_RESPONSE_H
35#include <unordered_map>
114 void setHeader(std::
string key, std::
string value);
122 void addHeader(std::
string key, std::
string value);
151 void setCookie(std::
string const& key, std::
string cookieContent);
183 void sendFile(std::
string const& path, std::
string const& contentType = "",
bool forceDownload = false,
184 std::
string const& downloadFilename = "",
bool checkIfModifiedSince = false);
196 [[nodiscard]]
unsigned int getStatus() const;
203 [[nodiscard]] std::unordered_multimap<std::
string, std::
string>
getHeaders(
bool includeCookies = true) const;
Reader for config files and accessor to config values.
Structure for creating Cookie objects. Content can be set by using a constructor.
Class which represents request objects.
Class for managing sessions and getting and setting connection-independent session data.
nawa::Session & session() noexcept
void addHeader(std::string key, std::string value)
void setCookiePolicy(Cookie policy)
void unsetHeader(std::string key)
nawa::Config & config() noexcept
void setStatus(unsigned int status)
unsigned int getStatus() const
void setCookie(std::string const &key, Cookie cookie)
void setHeader(std::string key, std::string value)
std::ostream & responseStream() noexcept
std::unordered_multimap< std::string, std::string > getHeaders(bool includeCookies=true) const
bool applyFilters(AccessFilterList const &accessFilters)
std::string getResponseBody()
nawa::Request const & request() const noexcept
void sendFile(std::string const &path, std::string const &contentType="", bool forceDownload=false, std::string const &downloadFilename="", bool checkIfModifiedSince=false)
void unsetCookie(const std::string &key)
void setResponseBody(std::string content)
Macros for frequently used patterns.
#define NAWA_DEFAULT_DESTRUCTOR_DEF(Class)
#define NAWA_PRIVATE_DATA()