DWP  Demo  Example×  

An HTTP Experiment

Click the Go button to send the following HTTP Get request to sofpower.com

GET /index.html HTTP/1.1
HOST: sofpower.com

And the result (HTTP response) will be displayed below.


Code

On Linux/UNIX systems use the Shell script:

#!/bin/bash
/usr/bin/nc sofpower.com 80 >| httpResponse <<HERE
GET /index.html HTTP/1.1
HOST: sofpower.com

HERE

See Chapter 1 Hypertext Transfer Protocol