SendJsonDomRequest

SendJsonDomRequest 1:

This method sends a request with a JSON object payload to a HTTP server. This method can be used, for example, if the server only accepts JSON object payloads.

Syntax

METHOD SendJsonDomRequest : BOOL
VAR_IN_OUT CONSTANT
    sUri         : STRING;
END_VAR
VAR_INPUT
    fbClient     : REFERENCE TO FB_IotHttpClient;
    eRequestType : ETcIotHttpRequestType;
    fbJson       : REFERENCE TO FB_JsonDomParser;
    fbHeader     : REFERENCE TO FB_IotHttpHeaderFieldMap;
END_VAR

SendJsonDomRequest 2: Return value

Name

Type

Description

SendJsonDomRequest

BOOL

Returns TRUE if the method call was successful.

SendJsonDomRequest 3: Inputs

Name

Type

Description

fbClient

REFERENCE TO FB_IotHttpClient

The HTTP client function block instance from which the request should be sent.

eRequestType

ETcIotHttpRequestType

The type of HTTP command the request should have. The list can be found in the appendix.

fbJson

REFERENCE TO FB_JsonDomParser

The instance of JsonDomParser for parsing a string to a JSON object.

fbHeader

REFERENCE TO FB_IotHttpHeaderFieldMap

The instance of IotHttpHeaderFieldMap to edit the header of the HTTP request.

SendJsonDomRequest 4:/SendJsonDomRequest 5: Inputs/outputs

Name

Type

Description

sUri

STRING

The identifier of the resource on the host. Please note, that the sUri is appended to the host name of the IotHttpClient.