如何从响应中只读正文
How to read only body from response
我看到的阅读响应的示例如下所示。但这会打印出响应标头以及响应正文。野兽是否暴露了一种仅将身体作为绳子的方法?我看起来可以访问res.body
但我不确定如何获取并转换它。
// Declare a container to hold the response
http::response<http::dynamic_body> res;
// Receive the HTTP response
http::read(socket, buffer, res);
// Write the message to standard out
std::cout << res << std::endl;
使用 htpp::string_body
而不是 http::dynamic_body
然后获取 res.body
相关文章:
- 非常量变量只读位置的赋值
- 是否可以在C++中使变量真正只读
- Azure Kinect 使用正文索引映射裁剪正文
- 犰狳C++ - 从常量内存初始化只读矩阵而不复制
- 我无法在Visual Studio代码中使用CIN输入答案,它说输入您的年龄,但它说只读文本编辑器如何解决这个问题?
- 以只读模式打开数据库时SQLITE_CANTOPEN错误
- C++/QT:使用指向私有成员的常量指针作为只读数据共享
- 元组元素是只读的?
- 为什么调用没有正文的纯虚拟方法不会导致链接器错误?
- 获取加密的正文响应WinHttp HTTPS
- 如何修复只读对象中成员的错误分配?
- 从只读内存中读取结构
- reinterpret_cast,只读访问,简单的可复制类型,会出什么问题?
- 在只读(即 const)访问器上执行结构化绑定的最佳实践是什么?
- 当我在C++中调用 struce 的只读静态成员时,线程是否安全
- 如何 Lambda 线程正文
- 属性分配无效:"displayText"是文本字段 qml 中的只读属性
- 在只读方案中,何时需要以 null 结尾的字符串?
- 为什么使用_access时只读测试对读写文件有效
- 如何从响应中只读正文