GetJsonDomContent

GetJsonDomContent 1:

Using GetContent, the response from an HTTP server is saved in a variable. If the received message is a JSON string, it can be saved in a JSON object to use the functions of the PLC library Tc3_JsonXml.

The GetJsonDomContent method saves the response directly in a JSON object. This skips the string conversion step. To be able to read the content of an HTTP response, the bBusy output of the function block FB_IotHttpRequest must return FALSE.

Syntax

METHOD GetJsonDomContent : SJsonValue
VAR_INPUT
    fbJson : REFERENCE TO FB_JsonDomParser;
END_VAR

GetJsonDomContent 2: Return value

Name

Type

Description

GetJsonDomContent

SJsonValue

JSON root node to start parsing.

GetJsonDomContent 3: Inputs

Name

Type

Description

fbJson

REFERENCE TO FB_JsonDomParser

The instance of the JsonDomParser that is to be used to parse the JSON object.