c++ - 如何摆脱 json 消息中的 POST 详细信息?
问题描述
我收到一条包含 JSON 的 msg,但在解析 JSON 详细信息时遇到问题。我收到的味精是:
POST /api/school/2/order HTTP/1.1
User-Agent: Guzzle/4.0 curl/7.21.4 PHP/5.5.7
content-type: application/json
Content-Length: 12
{
"json msg is here"
}
我想摆脱前 4 行 ..
有什么建议么 ?
解决方案
那是因为您正在以纯文本形式检索数据。 然后,您将使用 libCURL 来获取实际的 JSON 数据。然后用一些像jsoncpp这样的C++库来解析它。
推荐阅读
- sql - SQL - 部分根据另一个表选择行
- reactjs - Reactjs中的自动递减文本区域
- vb.net - 如何删除处理程序事件?
- php - PHP 警告:PHP 启动:无法加载动态库“session.so”
- python - 如何在 Python 中引发 JSONDecodeError
- scala - 火花列“子字符串”在其他列(行)中存在时替换
- node.js - 即使通过身份验证,也无法使用 SASL_SSL 和 Kerberos 使用消息
- amazon-web-services - Lambda 函数未授权执行 apigateway:GET
- r - 使用 r 中的不同 dfs 将类别映射到日期
- python - 函数内部函数的多处理错误(仅在 PyCharm 中运行时)