Skip to content

Commit

Permalink
Merge pull request #212 from hg333/custom-type-support
Browse files Browse the repository at this point in the history
http_response.h : added custom type support
  • Loading branch information
The-EDev committed Aug 29, 2021
2 parents 7ce2433 + 9546058 commit 0a526f9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/crow/http_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ namespace crow
{
*this = std::move(r);
}

response(std::string contentType, std::string body) : body(std::move(body))
{
set_header("Content-Type",mime_types[contentType]);
}

response(int code, std::string contentType, std::string body): code(code),body(std::move(body))
{
set_header("Content-Type",mime_types[contentType]);
}

response& operator = (const response& r) = delete;

Expand Down

0 comments on commit 0a526f9

Please sign in to comment.