I am using cjson
library to create json
and send it to server. I am using following code
char *string = cJSON_Print(json);
For which I get following output
{
"type1": "car",
"type2": "bus",
}
But the server expects it in string format like this
"{\n\t\"type1\":\t\"car\",\n\t\"type2\":\t\"bus\"\n}"
I am confused how can I achieve such conversion?