magpie
Loading...
Searching...
No Matches
magpie::CompressedResponse Struct Reference

#include <CompressedResponse.hpp>

Inheritance diagram for magpie::CompressedResponse:
Collaboration diagram for magpie::CompressedResponse:

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 StatusCodecode
std::shared_ptr< DataAdapterbody
std::string contentType = "text/plain"

Detailed Description

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.


The documentation for this struct was generated from the following files: