E.g and explaination:
- Pre-condition: Server is running and can reciever CURL command with json format message, libcurl and jsoncpp lib installed and configured in makefile.
- Curl command line. use POST command to request data
- curl -X POST http://xx.xx.xx.xx:port/rest/xxx -H 'Content-Type: application/json' -H 'fieldname: value' -d'{"yyy" :{"fieldname1" :{"Value" : "999"},"fieldname2" :{"Value" : "777"}}'
C++ code to send request to get access token:
#define RESPONSE_BODY_SIZE 4096
int getData()
{
CURLcode res;
CURL * curl;
JSONCPP_STRING errs;
Json::Value root, res_output;
Json::CharReaderBuilder reader_builder;
bool json_res;
char response_body[RESPONSE_BODY_SIZE] = {'