Rename HttpResponse's payload to body (#245)

* rename payload to body

* Fixed ws cmd line tool to use the renamed body

Co-authored-by: Jay <jasoncarr@Jasons-MacBook-Pro.local>
This commit is contained in:
carr-7
2020-09-13 03:01:37 +01:00
committed by GitHub
parent 128bc0afa9
commit 39c84c7d51
6 changed files with 13 additions and 13 deletions

View File

@ -178,7 +178,7 @@ namespace ix
// Write headers
ss.str("");
ss << "Content-Length: " << response->payload.size() << "\r\n";
ss << "Content-Length: " << response->body.size() << "\r\n";
for (auto&& it : response->headers)
{
ss << it.first << ": " << it.second << "\r\n";
@ -190,6 +190,6 @@ namespace ix
return false;
}
return response->payload.empty() ? true : socket->writeBytes(response->payload, nullptr);
return response->body.empty() ? true : socket->writeBytes(response->body, nullptr);
}
} // namespace ix

View File

@ -39,7 +39,7 @@ namespace ix
std::string description;
HttpErrorCode errorCode;
WebSocketHttpHeaders headers;
std::string payload;
std::string body;
std::string errorMsg;
uint64_t uploadSize;
uint64_t downloadSize;
@ -48,7 +48,7 @@ namespace ix
const std::string& des = std::string(),
const HttpErrorCode& c = HttpErrorCode::Ok,
const WebSocketHttpHeaders& h = WebSocketHttpHeaders(),
const std::string& p = std::string(),
const std::string& b = std::string(),
const std::string& e = std::string(),
uint64_t u = 0,
uint64_t d = 0)
@ -56,7 +56,7 @@ namespace ix
, description(des)
, errorCode(c)
, headers(h)
, payload(p)
, body(b)
, errorMsg(e)
, uploadSize(u)
, downloadSize(d)