Search code examples
c++jsonpoco-librariesrapidjson

String to JSON in Poco/JSON or rapidjson


i want to convert the following std::string message into a json object so that I can easily to traverse the object and get the key/value pair as needed.

I prefer to use either rapidjson or Poco::JSON

std::string request;
std::cout << request << std::endl;

This is the output of request:    {"USER_ID":"1","Exchange":"NASDAQ","ActionType":"BUY","OrderType":"MARKET","Quantity":"100","TimeInForce":"GTC"}

Solution

  • convert the string to document, then parse