Professional Documents
Culture Documents
a Web?
www.facebook.com
DNS
GET
GET / HTTP/1.1
Host: www.facebook.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS
X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
Accept: text/html,application/xhtml
+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pt-br,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: datr=[...]; locale=pt_BR...
200
HTTP/1.1 200 OK
Cache-Control: private, no-store, no-cache, must-revalidate, post-
check=0, pre-check=0
Expires: Sat, 01 Jan 2000 00:00:00 GMT
P3P: CP="DSP LAW"
Pragma: no-cache
Set-Cookie: reg_fb_ref=http%3A%2F%2Fwww.facebook.com%2F; path=/;
domain=.facebook.com
test_cookie=1; path=/; domain=.facebook.com
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
X-Cnection: close
Date: Sat, 20 Feb 2010 23:38:10 GMT
Content-Length: 8019
HTTP RESPONSE
HTTP É
STATELESS
E o que isso significa?
STATELESS
[CORPO (opcional)]
HTTP REQUEST
[CONTEÚDO (opcional)]
HTTP RESPONSE
HTTP/1.1 200 OK
Date: Mon, 23 May 2009 22:38:34 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Etag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8
Conteúdo...
TIPOS DE REQUEST
GET
GET / HTTP/1.1
Host: www.google.com.br
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:
1.9.2) Gecko/20100115 Firefox/3.6
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pt-br,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: HSID=A8Ut3HaGbD-MIrZUl;[...]
Cache-Control: max-age=0
GET
HTTP/1.1 200 OK
Date: Fri, 26 Feb 2010 17:34:05 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
Server: gws
Content-Length: 5121
X-XSS-Protection: 0
email=email%40exemplo.com&nome=Fulano%20de%20tal
POST
HTTP/1.1 200 OK
Date: Fri, 26 Feb 2010 17:48:32 GMT
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2
PHP/5.3.1
X-Powered-By: PHP/5.3.1
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: public
Pragma: no-cache
Content-Length: 2887
Connection: close
Content-Type: text/html
[CONTEÚDO]
OUTROS MÉTODOS
• PUT
• DELETE
• TRACE
• ...
CÓDIGOS DE RETORNO
CÓDIGOS DE RETORNO