Use C++ Client API

The generated c++ api dir structure is

   UserItem.h
   UserItemAPI.h
   UserItemAPI.cpp
   Makefile

How to use it:

  1. First use the makefile to generate a client api lib file
  2. Create REST Client intance
  3. Create named request instance
  4. Set request param values
  5. Use RestClient call request
  6. Use the return values

Here is a code snippet:

  #include <UserItem.h>
  #include <UserItemAPI.h>
  #include <CSHttpAPIBase.h>

  CSHttpAPIClientInfo client;
  client.sServerURI = "http://127.0.0.1:8001/api";
  UserGetAction req(client);
  req.setUserName("test");

  if (req.execute()) {
    printf("user email: %s\n", req.result->email.c_str());  
  } else {
    printf("Get User Error:%s\n", req.getErrorMessage().c_str());
  }