I am new to C++ REST ('Casablanca'). I read the tutorial here. After than, I took a sample code from there and tried to run it on my machine.
Below is the code
std::map<utility::string_t, utility::string_t> dictionary;
void handle_get(http_request request)
{
TRACE(L"\nhandle GET\n");
web::json::value::field_map answer;
for (auto const & p : dictionary)
{
answer.push_back(std::make_pair(json::value(p.first), json::value(p.second)));
}
request.reply(status_codes::OK, json::value::object(answer));
}
int main()
{
http_listener listener(L"http://127.0.0.1:8080/stockData");
listener.support(methods::GET, handle_get);
return 0;
}
In this code, I am getting error as below
I checked the header file json.h
and could not find a member (class/struct) named field_map
Please help