ns=2;s=DEPRAG Smart/Network/HTTP/REST/ActiveClients/0/ContentType
Sets or retrieves the content type HTTP header.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bHttpReadContentType : BOOL;
bHttpWriteContentType : BOOL;
ContentType : STRING(255);
hrHttpContentType : HRESULT;
fbHttpRest : FB_HttpRest;
END_VAR
hrHttpContentType := fbHttpRest.ReadContentType(
bExecute := bHttpReadContentType,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
ClientId := '0',
Output => ContentType);
IF hrHttpContentType <> S_FALSE THEN
bHttpReadContentType := FALSE;
END_IF
hrHttpContentType := fbHttpRest.WriteContentType(
bExecute := bHttpWriteContentType,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
ClientId := '0',
PointerToNodeValue := ADR(ContentType),
SizeOfNodeValue := SIZEOF(ContentType));
IF hrHttpContentType <> S_FALSE THEN
bHttpWriteContentType := FALSE;
END_IF
For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".