Note: The TCP port (third parameter) that is typically used is port 80, which is the
TCP Port for HTTP. Depending on your application, you may use a different port.
2.6. Send Data via HTTP
In order to send data to the website, you can use the HTTP POST command.
The syntax of the POST command is as follows:
POST /test/demo_form.asp HTTP/1.1
POST is the HTTP command being issued, /text/demo_form.asp is the endpoint
on the server, and HTTP/1.1 is the HTTP version you will be using.
Note: For this step, you will not be able to see the text you are typing. To ensure
that the data is accurate, it is recommended to copy and paste in the data.
However, this is not necessary.
In the terminal program, enter the POST data you would like to send according to
the above syntax. Make sure that the data is formatted to how your server is
expecting it. Once you type the data, press CTRL+M CTRL+J CTRL+M CTRL+J.
This will enter the two sets of carriage return/new line characters necessary to
signal to the server that data transmission is complete. After a short delay, the
terminal program should display:
HTTP/1.1 2xx OK
[text response from server]
NO CARRIER
where 2xx is the successful response code of the HTTP server. 200 is the
general HTTP/1.1 response of OK, meaning that the response was received
properly. There are derivations of the 2xx response, however. If you receive an
unexpected value, please consult the HTTP/1.1 Protocol Documentation at the
following URL:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
2.7. Receive Data via HTTP
In order to receive data from a website, you must use the HTTP GET command.
The syntax of the GET command is similar to the POST command, and is as
follows:
GET /test/demo_form.asp HTTP/1.1
where GET is the HTTP command being issued, /text/demo_form.asp is the
location of the data, and HTTP/1.1 is the HTTP version you will be using.
PN 30050 rev 10 © NimbeLink Corp. 2019. All rights reserved. 7