Mercurial > hg > orthanc
diff Core/HttpServer/HttpOutput.cpp @ 324:64925c94825c
api improvement
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 08 Jan 2013 09:29:56 +0100 |
parents | 1ac3aacd10a5 |
children | 78a8eaa5f30b |
line wrap: on
line diff
--- a/Core/HttpServer/HttpOutput.cpp Mon Jan 07 16:48:35 2013 +0100 +++ b/Core/HttpServer/HttpOutput.cpp Tue Jan 08 09:29:56 2013 +0100 @@ -32,6 +32,7 @@ #include "HttpOutput.h" +#include <iostream> #include <vector> #include <stdio.h> #include <boost/lexical_cast.hpp> @@ -76,10 +77,18 @@ Send(&s[0], s.size()); } + void HttpOutput::SendOkHeader(const HttpHandler::Arguments& header) + { + std::string s = "HTTP/1.1 200 OK\r\n"; - void HttpOutput::SendCustomOkHeader(const std::string& customHeader) - { - std::string s = "HTTP/1.1 200 OK\r\n" + customHeader + "\r\n"; + for (HttpHandler::Arguments::const_iterator + it = header.begin(); it != header.end(); it++) + { + s += it->first + ": " + it->second + "\r\n"; + } + + s += "\r\n"; + Send(&s[0], s.size()); }