DefaultRequestHeaders

Read TwinCAT TIA
Network REST Client ActiveClients One client

ns=2;s=DEPRAG Smart/Network/HTTP/REST/ActiveClients/0/DefaultRequestHeaders

Predefined headers that are sent each time the REST API is called.

Examples:

In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:

Beckhoff parameter:

    bHttpReadDefaultRequestHeaders
    A boolean variable that can be used to trigger the execution of the ReadDefaultRequestHeaders command.
    OutputHttpReadDefaultRequestHeaders
    An array of STRING variables in which the headers that will be sent are stored.
    hrHttpReadDefaultRequestHeaders
    This can be used to monitor the execution of the command. Error codes have the type HRESULT.
    fbHttpRest
    An instance of the "FB_HttpRest" function block supplied with the DEPRAG Smart library.
    ClientId
    A String(255) variable that specifies the client that should execute the command.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
     bHttpReadDefaultRequestHeaders  : BOOL;
     OutputHttpReadDefaultRequestHeaders : ARRAY[1..100] OF STRING;
     hrHttpReadDefaultRequestHeaders  : HRESULT;

     fbHttpRest   : FB_HttpRest;
END_VAR


hrHttpReadDefaultRequestHeaders := fbHttpRest.ReadDefaultRequestHeaders(
       bExecute    := bHttpReadDefaultRequestHeaders,
       ConnectionHandle  := depragSmartConnection.ConnectionHandle,
       ClientId   := '0',
       Output    => OutputHttpReadDefaultRequestHeaders);
IF hrHttpReadDefaultRequestHeaders <> S_FALSE THEN 
     bHttpReadDefaultRequestHeaders := 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".