|
<< Click to Display Table of Contents >>
PLC Tag |
Use a PLC Tag to send a request to an API by configuring its parameters according to the next table.
Item |
<Route Alias>;<Template Name> |
N1 |
1 (one) |
N2 |
From 0 (zero) to 3 (three) |
N3 |
Not used, leave it in 0 (zero) |
N4 |
Not used, leave it in 0 (zero) |
Any writing operation to this Tag executes a request using the route configured in the Item parameter and, when needed, sends the body of a message based on the linked template.
The N2 parameter maps the HTTP request method. Possible values are 0: GET method, 1: POST method, 2: PUT method, or 3: DELETE method.
The result of this writing operation depends on the HTTP status code returned by the API. A request is considered successful when the response has any code in the 2XX range, from 200 to 299, such as 200: OK, 201: Created, 202: Accepted, or 204: No Content, and the response's body, if any, is processed normally. Codes outside this range, such as 4XX or 5XX, or a connection failure return a writing error to an application. In both cases, the received status code is recorded in the log file of this Driver.
NOTE |
If not all mandatory elements for a request are configured in the Block Tag for Sending, this writing operation fails. Likewise, if a request fails for any other reason, this writing operation is not completed successfully. |