本文整理汇总了C++中HTTPResponse::size方法的典型用法代码示例。如果您正苦于以下问题:C++ HTTPResponse::size方法的具体用法?C++ HTTPResponse::size怎么用?C++ HTTPResponse::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPResponse
的用法示例。
在下文中一共展示了HTTPResponse::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s
void HTTPResponseTest::testRead3()
{
std::string s("HTTP/1.1 200 \r\nContent-Length: 0\r\n\r\n");
std::istringstream istr(s);
HTTPResponse response;
response.read(istr);
assert (response.getVersion() == HTTPMessage::HTTP_1_1);
assert (response.getStatus() == HTTPResponse::HTTP_OK);
assert (response.getReason() == "");
assert (response.size() == 1);
assert (response.getContentLength() == 0);
assert (istr.get() == -1);
}
示例2: s
void HTTPResponseTest::testRead2()
{
std::string s("HTTP/1.0 301 Moved Permanently\r\nLocation: http://www.appinf.com/index.html\r\nServer: Poco/1.0\r\n\r\n");
std::istringstream istr(s);
HTTPResponse response;
response.read(istr);
assert (response.getStatus() == HTTPResponse::HTTP_MOVED_PERMANENTLY);
assert (response.getReason() == "Moved Permanently");
assert (response.getVersion() == HTTPMessage::HTTP_1_0);
assert (response.size() == 2);
assert (response["Location"] == "http://www.appinf.com/index.html");
assert (response["Server"] == "Poco/1.0");
assert (istr.get() == -1);
}