Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
cpprestsdk json test
#include <cpprest\json.h>
#include <string>
int _tmain(int argc, _TCHAR* argv[])
web::json::value root;
std::wstring filepath = L"config.json";
std::ifstream ifs;, std::ifstream::in);
if (ifs)
try {
auto jsonResult = web::json::value::parse(ifs);
auto value ="key").as_string();
auto value2 ="anotherkey").as_string();
auto value3 ="last").as_string();
catch (const std::exception& e) {
std::string reason = e.what();
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment