Vai al contenuto

Web Science/Part1: Foundations of the web/Hypertext Transfer Protocol/Making HTTP requests

Da Wikiversità, l'apprendimento libero.

Making HTTP requests

Obiettivi di apprendimento

nessun obbiettivo di apprendimento definito
Tu puoi definire gli obiettivi di apprendimento qui.
In generale puoi usare il bottone di modifica nell'angolo in alto a destra di una sezione per modificarne il contenuto.

Video

Trascrizione

explain the use of telnet as a tool to establish a TCP connection (also show wireshark network traffic?)

talk about the fact that http is a request response protocol and stateless

 telnet studywebscience.org 80
 OPTIONS / HTTP/1.0

(show response)

 telnet studywebscience.org 80
 GET /test/index.html HTTP/1.0
 Host: studywebscience.org

(show response)

Quiz

1 What is the syntax of an HTTP GET request using version 1.0 of HTTP?

GET HTTP/1.0 /path/filename\r\n\r\n
GET /path/filename HTTP/1.0\r\n\r\n
HTTP/1.0 GET /path/filename\r\n\r\n

2 How is the end of the HTTP request marked?

by closing the TCP connection
By an empty line
FINISH
none of the above

3 Which of the following are types of HTTP requests

GET
HELP
HEAD
READ
POST
CREATE
PUT
DELETE
ASK
TRACE
OPTIONS
TRANSFER
CONNECT
PATCH
UPDATE

4 How is the end of a HTTP/1.0 response marked?

by closing the TCP connection
By an empty line
FINISH
none of the above

5 What is meant when we say HTTP is a stateless protocol?

all requests have to be idempotent
it cannot be built on top of a connection oriented protocol which creates a session (like tcp)
no user session is created on the web server
Same HTTP requests will always be handled in the same way independent of the last time's outcome and of the last request.

6 Compare peer to peer protocols with client server protocols

P2P Client / Server
every host can make a request and every host can make a response.
some hosts can make requests and some hosts (potentially the same) can make responses.
everyone is allowed to start a conversation and send data
load on the system can become an essential problem
the more hosts using the protocol the more reliable it becomes.
there is no authority

Discussioni