■開発環境
CentOS 5.10
■ソースコード
■実行結果
$ ./httpclient rinevo.com 80 / | head -n 25 addr=203.189.109.176 port=80 len=36, buf= GET / /HTTP/1.1 HOST:rinevo.com HTTP/1.1 200 OK Date: Fri, 06 Feb 2015 15:33:56 GMT Server: Apache X-Powered-By: PHP/5.3.15 Vary: Accept-Encoding,Cookie Cache-Control: max-age=3, must-revalidate WP-Super-Cache: Served supercache file from PHP Content-Type: text/html; charset=UTF-8 Connection: close <!DOCTYPE html> <!--[if IE 6]> <html id="ie6" lang="ja"> <![endif]--> <!--[if IE 7]> <html id="ie7" lang="ja"> <![endif]--> <!--[if IE 8]>
■参考サイト
telnetでブラウズ(HTTP)
http://ash.jp/net/telnet_http.htm