====== HTTP ====== Liens: *http://fr.wikipedia.org/wiki/Hypertext_Transfer_Protocol *http://www.iprelax.fr/http/1945tm.php Vu sous l'angle du protocole et de la programmation. ===== get ===== ==== HTTP 0 ==== Simple: $ echo "GET /" | nc thierry-jaouen.fr 80 301 Moved Permanently

Moved Permanently

The document has moved here.

Pareil mais en plus precis: $ echo -n -e "GET /\n" | nc thierry-jaouen.fr 80 ==== HTTP 1 ==== Mais tout le monde parle en HTTP 1 de nos jours... donc: $ echo -n -e "GET / HTTP/1.0\n\n" | nc thierry-jaouen.fr 80 HTTP/1.1 301 Moved Permanently Date: Fri, 22 Jan 2010 12:18:02 GMT Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny4 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g mod_musicindex/1.2.2 mod_perl/2.0.4 Perl/v5.10.0 Location: http://www.thierry-jaouen.fr Content-Length: 236 Connection: close Content-Type: text/html; charset=iso-8859-1 301 Moved Permanently

Moved Permanently

The document has moved here.

Ce qui retourne un peu plus d'information sur le serveur HTTP. ===== host ===== Changez d'"hote" (le nom de la machine qu'on vise derrière l'ip unique)... Par exemple, on veut atteindre l'hôte ''dvdrip.fr'' : $ echo -n -e "GET / HTTP/1.0\nHost: dvdrip.fr\n\n" | nc thierry-jaouen.fr 80 HTTP/1.1 302 Found Date: Fri, 22 Jan 2010 12:21:28 GMT Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny4 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g mod_musicindex/1.2.2 mod_perl/2.0.4 Perl/v5.10.0 Location: http://dvdrip.fr/dvdrip.html Content-Length: 213 Connection: close Content-Type: text/html; charset=iso-8859-1 302 Found

Found

The document has moved here.