http发送的body

在这里插入图片描述

c++http服务收到的

在这里插入图片描述

先使用boost解析json

1
2
3
4
5
6
7
boost::json::error_code ec;
boost::json::parse_options opt; // all extensions default to off
opt.allow_comments = true; // permit C and C++ style comments to appear in whitespace
opt.allow_trailing_commas = true; // allow an additional trailing comma in object and array element lists
opt.allow_invalid_utf8 = true; // skip utf-8 validation of keys and strings
//auto m_json = boost::json::parse(cszJsonString, ec);
auto json = boost::json::parse(strJson, ec, {}, opt);

然后转GBK

1
auto gbk = boost::locale::conv::between(sourcePath, "GBK", "UTF-8");

在这里插入图片描述