|
|
| 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) |
|
| static void | redirect (Response &out, std::string &&dest, bool permanent=false) |
| static void | moved (Response &out, std::string &&dest) |
|
| std::unordered_map< std::string, std::string > | headers |
|
const StatusCode * | code |
|
std::shared_ptr< DataAdapter > | body |
|
std::string | contentType = "text/plain" |
◆ moved()
| void magpie::Response::moved |
( |
Response & | out, |
|
|
std::string && | dest ) |
|
static |
Creates a Response object for redirecting to another target. This function specifically sends MovedPermanently instead of PermanentRedirect or TemporaryRedirect, like Response::redirect does
- Warning
- There is no validation on dest, so user-generated redirects may end up malicious. Ways to sanitise the URIs is a future feature.
- Parameters
-
| out[out] | The request object to modify |
| dest | The destination to redirect to. |
◆ redirect()
| void magpie::Response::redirect |
( |
Response & | out, |
|
|
std::string && | dest, |
|
|
bool | permanent = false ) |
|
static |
Creates a Response object for redirecting to another target.
- Warning
- There is no validation on dest, so user-generated redirects may end up malicious. Ways to sanitise the URIs is a future feature.
- Parameters
-
| out[out] | The request object to modify |
| dest | The destination to redirect to. |
| permanent | Whether or not the redirect is permanent |
◆ headers
| std::unordered_map<std::string, std::string> magpie::Response::headers |
The documentation for this struct was generated from the following files:
- src/magpie/transfer/Response.hpp
- src/magpie/transfer/Response.cpp