To return data on a Rest Web Server, you have to provide JSON data file format. To illustrate the sample (see my previous post), I have decided to return a simple structure:
- std::vector
peoples - utility::string_t job
The People structure contains just:
- utility::string_t name
- double age
I have made a little modification on my PUT handler to return data:
The last piece of code is the code that produce the AsJSON() function call.
For each structure, there is a AsJSON and a FromJSON
You can see the result on the console output of the Server. On the client side, ask the method called ‘leave’.
You can download the C++ client and server.
This post first appeared on MSDN Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The MSDN Blogs., please read the originial post: here