mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-30 12:50:58 +00:00
docs nits
This commit is contained in:
1 parent
4e880fb6e0
commit
47ce004f61
2 files changed
+5
-6
No files matched your search
+3
-4
@@ -1072,11 +1072,10 @@ Send a simple JSON response:
|
||||
mg_http_reply(c, 200, "Content-Type: application/json\r\n", "{\"result\": %d}", 123);
|
||||
```
|
||||
|
||||
Send JSON response using [mjson](https://github.com/cesanta/mjson) library:
|
||||
Send JSON response:
|
||||
```c
|
||||
char *json = NULL;
|
||||
mjson_printf(mjson_print_dynamic_buf, &json, "{%Q:%d}", "name", 123);
|
||||
mg_http_reply(c, 200, "Content-Type: application/json\r\n", "%s", json);
|
||||
char *json = mg_mprintf("{%Q:%d}", "name", 123);
|
||||
mg_http_reply(c, 200, "Content-Type: application/json\r\n", "%s\n", json);
|
||||
free(json);
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user