|
magpie
|
#include <CompressedResponse.hpp>


Public Member Functions | |
| CompressedResponse (const Request &req, const StatusCode &code, std::string &&body, std::string &&contentType="text/plain") | |
| Public Member Functions inherited from magpie::Response | |
| Response (const StatusCode &code, std::string &&body, std::string &&contentType="text/plain") | |
| Response (const StatusCode &code, std::shared_ptr< DataAdapter > &&bodyAdapter, std::string &&contentType) | |
| Response (Response &&)=delete | |
| Response (Response &)=delete | |
| void | setBody (std::string &&body) |
| Response & | operator= (Response &&other)=default |
| Response & | operator= (CompressedResponse &&other) |
Additional Inherited Members | |
| Static Public Member Functions inherited from magpie::Response | |
| static void | redirect (Response &out, std::string &&dest, bool permanent=false) |
| static void | moved (Response &out, std::string &&dest) |
| Public Attributes inherited from magpie::Response | |
| std::unordered_map< std::string, std::string > | headers |
| const StatusCode * | code |
| std::shared_ptr< DataAdapter > | body |
| std::string | contentType = "text/plain" |
Used for a response that should be compressed.
Do not use for binary data, or data that is otherwise already compressed. Compressing compressed data is just a waste of compute for no compression ratio. Zlib should avoid the response being significantly bigger (aside a <1% overhead due to zlib header bytes), but there is still extra overhead.