Created
December 8, 2011 07:23
-
-
Save rogerz/1446378 to your computer and use it in GitHub Desktop.
jansson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Free jansson object by json_decref() | |
void cgi_JSON() | |
{ | |
json_t *pObj = json_pack ("{s:i, s:s}", "foo", 1, "bar", "string"); | |
char *pString = json_dumps(pObj, JSON_INDENT(2)); | |
HttpSend(pString); | |
free(pString); | |
json_decref(pObj); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment