www por debaixo dos panos

Marco Rougeth

Programador Crave Food Services

crave.workable.com

telegram @rougeth

rgth.co

CLIENTE

SERVIDOR

PROTOCOLO

browsers, crawlers, scrapers, scripts...

máquinas físicas, máquinas virtuais, sua própria máquina...

HTTP, HTTPS, FTP, SMTP, SSH...

URL Parser

esquema :// domínio : porta / caminho ? query_string # fragmento

RFC 1738

https://github.com/stars?language=python

https://github.com/django/django#readme

http://localhost:8000

DNS

cache

gethostbyname

/etc/hosts

DNS servers

root-servers.org

$ dig @a.root-servers.net informaticabiomedica.fmrp.usp.br

[...]

;; AUTHORITY SECTION:
br.			172800	IN	NS	f.dns.br.
br.			172800	IN	NS	e.dns.br.
br.			172800	IN	NS	b.dns.br.
br.			172800	IN	NS	c.dns.br.
br.			172800	IN	NS	d.dns.br.
br.			172800	IN	NS	a.dns.br.

[...]
$ dig @a.dns.br informaticabiomedica.fmrp.usp.br

[...]

;; AUTHORITY SECTION:
usp.br.			86400	IN	NS	bee.uspnet.usp.br.
usp.br.			86400	IN	NS	reno.uspnet.usp.br.
usp.br.			86400	IN	NS	bee08.uspnet.usp.br.
usp.br.			86400	IN	NS	ns1.ansp.br.
usp.br.			86400	IN	NS	reno08.uspnet.usp.br.

[...]
$ dig @reno.uspnet.usp.br informaticabiomedica.fmrp.usp.br

[...]

;; AUTHORITY SECTION:
fmrp.usp.br.		21600	IN	NS	bee.uspnet.usp.br.
fmrp.usp.br.		21600	IN	NS	perola.cirp.usp.br.
fmrp.usp.br.		21600	IN	NS	dns1.fmrp.usp.br.

[...]
$ dig @dns1.fmrp.usp.br informaticabiomedica.fmrp.usp.br

[...]

;; ANSWER SECTION:
informaticabiomedica.fmrp.usp.br. 100 IN A	200.144.254.19

[...]

HTTP

Hypertext Transfer Protocol

GET /sobre HTTP/1.1
HOST: github.com

GET

POST

PUT

Métodos

PATCH

DELETE

OPTIONS

Create       POST          /livros

Read         GET             /livros/1

Update      PUT             /livros/1

Delete       DELETE      /livros/1

CRUD

Headers

User-Agent: Mozilla/5.0
Accept: text/html
Accept-Language: pt-BR

Body

nome=Marco&grupo=pyladies

POST / PUT

HTTP/1.1 200 OK
Content-Type: text/html
charset: utf-8
<html>
1** Informação
2** Sucesso
3** Redirecionamento
4** Erro de cliente
5** Erro de servidor

web

By Marco Rougeth

Loading comments...

More from Marco Rougeth