namespace seafire::representation { template void send(server::request_t& req, server::response_t& res, protocol::status_code_t status, R const& rep, bool send_content) { namespace rfc7231 = protocol::rfc7231; namespace rfc7232 = protocol::rfc7232; set(res, rep.type()); if (auto etag = get_etag(rep); etag) { set(res, *etag); } if (auto last_modified = get_last_modified(rep); last_modified) { set(res, *last_modified); } if (!send_content) { res.send(status); return; } auto content_stream = res.allocate_stream(); rep.write_to(content_stream); res.send(status, content_stream); } } // namespace seafire::representation