InboundJSONBind

The InboundJSONBind handler allows JSON requests to be received and JSON responses to be sent.

When the RECEIVE command of this content handler is executed the following steps occur:

1.  If there is no content, then an OK status is returned.

2.  The handler checks that the content type belongs to the JSON group of content types, if it does not support the content type, then an error is returned to the program. Use the CONTENT keyword to override this check and to allow the handler to receive the data, it is assumed the data is JSON.

3.  The handler parses the JSON content into a JSON object ready for the BIND command.

The encoding of the content is assumed to be UTF-8.

Syntax:

Command

Keyword

Value

Developer notes

RECEIVE

HANDLER

InboundJSONBind

 

CONTENT

 

Optional. See CONTENT.

ARCHIVE

 

Optional. See ARCHIVE.

 

Example

RECEIVE HANDLER(InboundJSONBind)

 

When the SEND command of this content handler is executed the following steps occur:

1.  The handler determines if this Unicode data needs to be archived.

2.  The handler creates a HTTP response to return to the remote client.

3.  The content type is application/json and the content encoding is UTF-8.

The optional UAFILE and UAPATH keywords are available to inform the remote client program of a recommended path and filename for the content. LANSA Integrator UserAgent will add these file and path names to the save popup menu on the response panel.

Syntax:

Command

Keyword

Value

Developer notes

SEND

HANDLER

InboundJSONBind

 

STATUS

value

Optional: HTTP status number.
Default: 200.

MESSAGE

value

Optional: HTTP status message.
Default: OK.

UAPATH

value

Optional. User agent save response path.

UAFILE

value

Optional. User agent save response filename.

UACACHE

value

Optional. Cache-Control max-age.
Default is 0.

UADISPOSITION

value

Optional. Content-Disposition filename.

ARCHIVE

 

Optional. See ARCHIVE.

 

Example

SEND HANDLER(InboundJSONBind)