# mcorest_api_json_write_key

Write a JSON key.

### For an overview see page mcorest_api_json_write_*

### Prototype

        MCO_RET mcorest_api_json_write_key( mcorest_api_json_write_ctx_t *ctx, const char *key );

### Arguments

ctx | Pointer to the JSON write context structure
key | Key name to write

### Description

This function writes a JSON key.

### Return Codes

MCO_S_OK = 0 | Success
MCO_E_REST_* | Any of the Web Services Error Codes

### Example

        static MCO_RET print_key(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;
        }

### Files

Header file:
mcorestapi.h
Source file:
jsonwr.c
Library:
libmcorest.a