Head - Method

Overview

Type:

Method

Available as of:

V1.0.0.0

Task

The method Head initiates the HTTP method to request a representation of the header of the specified resource.

Functional Description

By using the inputs i_sHost (mandatory) and i_sResource the default header of the HTTP request is created. If additional information must be added to the header, they must be passed through the input i_anyAdditionalHeader. Data assigned to this input is not verified. At the input i_anyResponseBuffer, you must assign a buffer of sufficient size for storing the entire response received from the server.

The return value of the method is of type BOOL and indicates whether the execution of the method was successful (TRUE) or not (FALSE). Evaluate the diagnostic outputs of the method, in case the return value is FALSE. An error indicated by these outputs needs no reset. The property State must be used to obtain the status of processing.

A call of the method Head is allowed only in state Connected.

State Transition of the Client

Stage

Description

1

Initial state: Connected

2

Function call

3

State: SendingRequest, otherwise an error is detected

4

Final state: ResponseAvailable, otherwise an error is detected

NOTE: In case of online modifications while the function block is processing a Head request, the execution is aborted to prevent a possible access violation caused by processing erroneous pointer addresses.

Interface

Input

Data type

Description

i_sResource

STRING[GPL.Gc_uiMaxLengthOfResource]

Specifies the resource on the host which is to be reached by the request.

i_sHost

STRING[GPL.Gc_uiMaxHostSize]

Specifies the address of the host, and if required, extended by the port.

i_anyAdditionalHeader

ANY_STRING

Specifies additional headers to be added to the HTTP request.

i_anyResponseBuffer

ANY

Buffer for storing the response from the server.

Output

Data type

Description

q_xError

BOOL

If this output is set to TRUE, an error has been detected. For details, refer to q_etResult and q_etResultMsg.

q_etResult

ET_Result

Provides diagnostic and status information as a numeric value.

q_sResultMsg

STRING[80]

Provides additional diagnostic and status information as a text message.