Skip to content

Commit fb8888b

Browse files
author
Sebastiano Merlino
committed
Added response constructor with byte
1 parent e4e452d commit fb8888b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/httpserver/http_response.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,18 @@ class http_string_response : public http_response
323323
http_string_response(const http_response& b) : http_response(b) { }
324324
};
325325

326+
class http_byte_response : public http_response
327+
{
328+
public:
329+
http_byte_response
330+
(
331+
const char* content,
332+
size_t content_length,
333+
int response_code,
334+
const std::string& content_type = "text/plain"
335+
): http_response(http_response::STRING_CONTENT, std::string(content, content_length), response_code, content_type) { }
336+
};
337+
326338
class http_file_response : public http_response
327339
{
328340
public:

0 commit comments

Comments
 (0)