Start reading JSON data from a stream.
MCO_RET mcorest_api_json_read_start( mcorest_api_stream_t *s,
mcorest_api_json_read_ctx_t *ctx);
| s | The mcorest_api_stream_t to read data from |
| ctx | Pointer to the JSON read context structure |
This function starts reading JSON data from a stream.
| MCO_S_OK = 0 | Success |
| MCO_E_REST_* | Any of the Web Services Error Codes |
static MCO_RET get_stream_read_json_object(mcohs_request_h req)
{
mcorest_api_json_read_ctx_t jctx;
mcorest_api_stream_t jstream;
...
mcorest_api_status_ok(req);
mcorest_api_stream_with_request(req, &jstream);
mcorest_api_json_read_start(&jstream, &jctx);
mcorest_api_json_read_next_token(&jctx, MCOREST_API_JSON_TKN_OBJECT_BGN, NULL);
...
mcorest_api_json_read_finish(&jctx);
return MCO_S_OK;
}