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

From Wikiversity
Jump to: navigation, search

Making HTTP requests

Wikiversity-Mooc-Icon-Edit.svg
Wikiversity-Mooc-Icon-Ask.svg
Wikiversity-Mooc-Icon-Learning-goals.svg

Learning goals

no learning goals defined
You can define learning goals here.
In general you can use the edit button in the upper right corner of a section to edit its content.
Wikiversity-Mooc-Icon-Edit.svg
Wikiversity-Mooc-Icon-Ask.svg
Wikiversity-Mooc-Icon-Video.svg

Video

Wikiversity-Mooc-Icon-Edit.svg
Wikiversity-Mooc-Icon-Ask.svg
Wikiversity-Mooc-Icon-Script.svg

Script

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)

Wikiversity-Mooc-Icon-Edit.svg
Wikiversity-Mooc-Icon-Ask.svg
Wikiversity-Mooc-Icon-Quiz.svg

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
No! This would make it impossible for the server to answer
By an empty line
yes \r\n\r\n can be used to create a line break + an empty line
FINISH
no this is just made up
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
no some of the HTTP request like post are not 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

Your score is 0 / 0
Wikiversity-Mooc-Icon-Discussion.svg

Discussion