Académique Documents
Professionnel Documents
Culture Documents
c.a.barcenilla@ieee.org
http://www.jmarshall.com/easy/http/
1
Mensajes HTTP
Mensajes HTTP
Solicitudes
Respuestas
Encabezado1: valor1
Encabezado2: valor2
<ms encabezados>
Encabezado N: valor N
<lnea en blanco>
Ejemplos:
Ejemplos:
HTTP/1.0 200 OK
HTTP/1.0 404 Not Found
GET / HTTP/1.1
7
Lneas de encabezado
1xx: Informativos
2xx: xito
3xx: Redireccin
4xx: Error de cliente
5xx: Error de servidor
Los ms comunes:
200 OK
Ejemplos:
User-Agent: Mozilla/6.0
From: juan@perez.com
Content-Type: text/html
El recurso no existe.
El recurso se ha movido a otra URL (Dada en el header Location)
Error no esperado en el servidor.
Lneas de encabezado
10
11
El mtodo HEAD
13
El mtodo POST
14
15
16
HTTP 1.1
18
Ejemplo:
GET /directorio/archivo.html HTTP/1.1
Host: www.sitio.com
[lnea en blanco]
20
Ejemplo:
HTTP/1.1 200 OK
Date: Sat, 18 Nov 2000 13:29:14 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
HTTP/1.1 200 OK
Date: Sat, 18 Nov 2000 13:29:14 GMT
Content-Type: text/plain
Content-Length: 45
Footer1: valor1
Footer2: valor2
21
22
Ejemplo:
23
Ejemplo
If-Unmodified-Since
Indica que solo se debe enviar el recurso solicitado si ste no ha
cambiado luego de la fecha especificada. Puede usarse con
cualquier mtodo. Si el recurso ha cambiado el servidor responde
con 412 Precondition Failed.
Ejemplo: If-Unmodified-Since: Sun, 12 Dec 1999 21:59:59 GMT
25
Ejemplo
26
Ejemplo
27
28
Ejemplo
Ejemplo
GET / HTTP/1.1
Accept: application/vnd.ms-excel, application/msword, image/gif, image/x-xbitmap,
image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, */*
Accept-Language: es-ar
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Host: www.datosenlaweb.com
Connection: Keep-Alive
HTTP/1.1 200 OK
Date: Sat, 18 Nov 2000 19:42:18 GMT
Server: Apache/1.3.12 Ben-SSL/1.40 (Unix) PHP/3.0.15
X-Powered-By: PHP/3.0.15
Set-Cookie: PHPSESSID=1191dab4f547c4a02a85143a4c918fd6
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
ecd
<HTML><HEAD........................................................................................ </td>
ffb
<form .................</html>
0
29
30
Ejemplo
Ejemplo
HEAD / HTTP/1.0
HTTP/1.0 302 Found
Content-Length: 155
Connection: Close
Server: GWS/2.0
Content-Type: text/html
Date: Mon, 07 Oct 2002 14:04:01 GMT
Location: http://www.google.com.ar/
Set-Cookie:
PREF=ID=66e653d35b020a90:TM=1033999441:LM=1033999441:S=
bGZmIPqKlM23W25B; expires=Sun, 17-Jan-2038 19:14:07 GMT;
path=/; domain=.google.com
31
32
Ejemplo (Request)
Ejemplo (Response)
HTTP/1.1 200 OK
Date: Mon, 07 Oct 2002 14:26:49 GMT
Server: Apache/1.3.23 (Unix) (Red-Hat/Linux) mod_ssl/2.8.7 OpenSSL/0.9.6b
DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
X-Powered-By: PHP/4.1.2
Set-Cookie: PHPSESSID=35bf915272e201ec63e2adfbbd9322f4; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
e0b
<html><head>.. ..</
19a
table><hr size="1">.</
19
center></body></html>
0
33
Ejemplo
34
Ejemplo (Request)
GET /docs/php/login.php3?PHPSESSID=35bf915272e201ec63e2adfbbd9322f4
HTTP/1.1
Referer: http://sg.rec.utn.edu.ar/docs/php/buscador.php3
Connection: Keep-Alive
35
Cookie: PHPSESSID=35bf915272e201ec63e2adfbbd9322f4
36
Ejemplo (Response)
HTTP/1.1 200 OK
Date: Mon, 07 Oct 2002 14:26:55 GMT
Server: Apache/1.3.23 (Unix) (Red-Hat/Linux) mod_ssl/2.8.7 OpenSSL/0.9.6b
DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
X-Powered-By: PHP/4.1.2
Pragma: no-cache
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
921
<html><head></html>
0
37