23 #include <webview/reply.h>
25 #include <core/exception.h>
61 WebReply::code()
const
72 WebReply::add_header(std::string header, std::string content)
74 __headers[header] = content;
82 WebReply::add_header(std::string header_string)
84 std::string::size_type pos;
85 if ((pos = header_string.find(
":")) != std::string::npos) {
86 std::string header = header_string.substr(0, pos);
88 if (header_string[pos+1] ==
' ') {
89 content = header_string.substr(pos+2);
91 content = header_string.substr(pos+1);
93 __headers[header] = content;
95 throw Exception(
"Invalid header '%s'", header_string.c_str());
104 WebReply::headers()
const
182 va_start(args, format);
184 if ( vasprintf(&s, format, args) != -1 ) {
217 std::string::size_type
220 return _body.length();