23 #ifndef HTTPRESPONSE_H_
24 #define HTTPRESPONSE_H_
28 #include "HttpRequest.h"
29 #include "AppDefines.h"
30 #include "HTTPResponseStatus.h"
31 #include "ContentTypes.h"
33 typedef vector<unsigned char> Cont;
38 string getContent_str()
const
43 void setContent_str(
string content_str)
45 this->content_str = content_str;
49 string getHttpVersion()
const
54 void setHttpVersion(
string httpVersion)
56 this->httpVersion = httpVersion;
61 this->statusCode = CastUtil::lexical_cast<
string>(status.getCode());
62 this->statusMsg = status.getMsg();
65 string getStatusCode()
const
70 void setStatusCode(
string statusCode)
72 this->statusCode = statusCode;
75 string getStatusMsg()
const
80 void setStatusMsg(
string statusMsg)
82 this->statusMsg = statusMsg;
85 string getDate()
const
90 void setDate(
string date)
95 string getConnection()
const
100 void setConnection(
string connection)
102 this->connection = connection;
105 string getServer()
const
110 void setServer(
string server)
112 this->server = server;
115 string getAccept_ranges()
const
117 return accept_ranges;
120 void setAccept_ranges(
string accept_ranges)
122 this->accept_ranges = accept_ranges;
125 string getContent_type()
const
130 void setContent_type(
string content_type)
132 this->content_type = content_type;
135 int getContent_len()
const
137 return content_str.length();
145 string getContent()
const
156 void setContent(
string content)
158 this->content_str = content_str;
162 string getLast_modified()
const
164 return last_modified;
167 void setLast_modified(
string last_modified)
169 this->last_modified = last_modified;
172 string getLocation()
const
176 void setLocation(
string location)
178 this->location = location;
181 string getWww_authenticate()
const
183 return www_authenticate;
185 void setWww_authenticate(
string www_authenticate)
187 this->www_authenticate = www_authenticate;
190 void addCookie(
string cookie)
192 this->cookies.push_back(cookie);
195 string generateResponse();
196 string generateHeadResponse();
197 string generateOptionsResponse();
206 string accept_ranges;
210 string last_modified;
213 vector<string> cookies;
214 string www_authenticate;