programmation_http
Ceci est une ancienne révision du document !
HTTP
Vu sous l'angle du protocole et de la programmation.
get
HTTP 0
Simple:
$ echo "GET /" | nc thierry-jaouen.fr 80 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="http://www.thierry-jaouen.fr">here</a>.</p> </body></html>
Pareil mais en plus precis:
$ echo -n -e "GET /\n" | nc thierry-jaouen.fr 80
Changez d'“hote” (le nom de la machine qu'on vise derrière l'ip unique):
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 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="http://www.thierry-jaouen.fr">here</a>.</p> </body></html>
Ce qui retourne un peu plus d'information sur le serveur HTTP.
host
programmation_http.1264162791.txt.gz · Dernière modification : 2010/01/22 12:19 de thierry