mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Merge pull request #36 from acron0/auto-json-content-type
Responses now auto to 'application/json' when constructed using json::wvalue
This commit is contained in:
commit
ccc5845c3e
File diff suppressed because it is too large
Load Diff
@ -41,8 +41,11 @@ namespace crow
|
||||
explicit response(int code) : code(code) {}
|
||||
response(std::string body) : body(std::move(body)) {}
|
||||
response(json::wvalue&& json_value) : json_value(std::move(json_value)) {}
|
||||
response(const json::wvalue& json_value) : body(json::dump(json_value)) {}
|
||||
response(int code, std::string body) : body(std::move(body)), code(code) {}
|
||||
response(const json::wvalue& json_value) : body(json::dump(json_value))
|
||||
{
|
||||
set_header("Content-Type", "application/json");
|
||||
}
|
||||
|
||||
response(response&& r)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user