Start writing JSON to a request's response stream.
MCO_RET mcorest_api_json_write_start(mcorest_api_stream_t *s,
mcorest_api_json_write_ctx_t *ctx);
| s | The mcorest_api_stream_t to write data to |
| ctx | Pointer to the JSON write context structure |
This function starts writing JSON to a request's response stream; opens the top-level JSON object.
| MCO_S_OK = 0 | Success |
| MCO_E_REST_* | Any of the Web Services Error Codes |
static MCO_RET get_stream_print_json_object(mcohs_request_h req)
{
mcorest_api_json_write_ctx_t jctx;
mcorest_api_stream_t jstream;
...
mcorest_api_status_ok(req);
mcorest_api_stream_with_request(req, &jstream);
mcorest_api_json_write_start(&jstream, &jctx);
mcorest_api_json_write_key(&jctx, "databases");
...
mcorest_api_json_write_finish(&jctx);
return MCO_S_OK;
}