Skip to content

Instantly share code, notes, and snippets.

@rogerz
Created December 8, 2011 07:23
Show Gist options
  • Save rogerz/1446378 to your computer and use it in GitHub Desktop.
Save rogerz/1446378 to your computer and use it in GitHub Desktop.
jansson
// 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