[gull] requête http avec perl

Félix Hauri felix at f-hauri.ch
Fri Jun 10 00:35:02 CEST 2005


Salut la liste,

On Thu, Jun 09, 2005 at 04:17:07PM +0200, Lol Zimmerli wrote:
> marquis at altern.org écrit/wrote:
> > ...
> > Si je fais  un "GET / HTTP/1.0" avec 2 'return' en telnet sur
> > www.edicom.ch 80,
> > j'ai un "400 Bad Request".
> Pas moi, pas maintenant. Je vois bien un document html.

Moi non plus:
$ echo $'GET / HTTP/1.0\n' | nc www.edicom.ch 80
HTTP/1.1 200 OK
Date: Thu, 09 Jun 2005 22:27:07 GMT
Server: Apache/1.3.26 (Unix)
Cache-Control: max-age=600
Expires: Thu, 09 Jun 2005 22:37:07 GMT
Content-Type: text/html
X-Cache: MISS from www.edicom.ch
Connection: close

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
...
<title>Edicom - Le média interactif de Suisse romande</title>
...

La requête est simple:
$ echo $'GET / HTTP/1.0\n'
La commande echo ajoutant automatiquement un saut de ligne, un seul suffit.
De plus, même en *ajoutant* des ``returns'':
$ echo $'GET / HTTP/1.0\r\n\r' | nc www.edicom.ch 80 | less
donne le même résultat.   

Bonne nuit.

-- 
 Félix Hauri  -  <felix at f-hauri.ch>  -  http://www.f-hauri.ch




More information about the gull mailing list