-
Hello everyone I'm trying to write the string "vars": {"category":"44"} to json, but for some unknown reason it writes iterators / to the string, the code below attempts to fix this problem (I didn't see any obvious solutions to the problem in the JSON documentation) json _dataPost;
_dataPost["vars"] = R"({"category":")" + param1 + R"("})"; Tell me how to solve this problem... |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I tried another way, for some reason I wrote down another \n characters json demo;
demo["vars"] =
{
{"category", param1.c_str()}
};
std::string ss = demo["vars"].dump(0);
paramStr = ss.c_str();
json _dataPost;
_dataPost["vars"] = paramStr.c_str(); |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Need "vars": {"category":"124325"}, |
Beta Was this translation helpful? Give feedback.
https://www.godbolt.org/z/1f76rWsej