The example demonstrates the evaluation of a web page. The URL for the request could be, e.g. http://www.example.net/wetter.php?plz=12345. The web server would return an HTML page with weather data as response. The entire data traffic contains the following data:
-- SEND: --
GET /wetter.php?plz=12345 HTTP/1.1
Host: www.example.net
Connection: Close
-- RECEIVE: --
HTTP/1.1 200 OK
Content-Type: text/html
Connection: Close
<html>
<body>
<h1>Aktuelle Wetterdaten für Musterhausen!<h1>
<table border="1">
<tr>
<td>Temperatur:</td><td>15 °C</td>
</tr>
<tr>
<td>Wind kommt von:</td><td>Norden</td>
</tr>
</table>
</body>
</html>
-- END --
The indicated URL does not exist. The data indicated above are intended as an example
The following data must be defined in the HS Expert:
1. General data
2. Send the request
There are two ways of sending a request under
"Send".
On the one hand, you can select the option "Send HTTP request"; the HS Expert generates the required data blocks automatically here when sending. The data blocks therefore do not have to be self-defined. However, in this case, the PLZ would be fixed:
- URL (only path): /wetter.php?plz=12345
Furthermore, the required data blocks can also be self-defined; in this case, a dynamic PLZ can be sent:
- Block 1
Type: Text
Any text: GET /wetter.php?plz=
- Block 2
Type: Value as plain text
Communication object which contains the required PLZ
Activate Use URL quoting
- Block 3
Type: Text
Any text: HTTP/1.1
The fields attach CR and attach LF must be activated.
Note: There must be an empty space in front of HTTP.
Explanation: Using the GET command, the remote terminal is informed which data are to be requested. As not only the file name but also parameters are transferred, the first line of the HTTP command must be split between several data blocks.
- Block 4
Type: Text
Any text: Host name: www.example.net
The fields attach CR and attach LF must be activated.
Explanation: The remote terminal must also be informed of the address at which the file has been downloaded.
- Block 5
Type: Text
Any text: Connection: Close
The fields attach CR and attach LF must be activated.
Explanation: The remote terminal wants to know whether the connection should be kept open after sending the data.
- Block 6
Type: Text
Any text:
The fields attach CR and attach LF must be activated.
Explanation: An empty line must be sent to conclude the request.
Note: Every data block must be concluded with CR and LF.
3. Receiving and evaluating the response