The method Delete initiates the HTTP method to delete the specified resource.
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 Delete 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 Delete request, the execution is aborted to prevent a possible access violation caused by processing erroneous pointer addresses.
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; if required in conjunction with the port. |
i_anyAdditionalHeader |
ANY_STRING |
Specifies additional headers to be added to the HTTP request. |
i_anyContent |
ANY |
Assigns the buffer containing the content to be submitted with the HTTP request. |
i_udiContentLength |
UDINT |
Length of the content in bytes. |
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 |
Provides diagnostic and status information as a numeric value. |
|
q_sResultMsg |
STRING[80] |
Provides additional diagnostic and status information as a text message. |