L2. Describe the functioning of the HTTP protocol and summarize different versions Flashcards

1
Q

What is HTTP?

A

The Hypertext Transfer Protocol (HTTP) is an application-layer protocol that serves as the basis of communication on the World Wide Web

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When is HTTP used?

A

For example, when a web browser requests a resource from a server, HTTP is the protocol that is used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What model does HTTP operate on?

A

HTTP operates on a client-server model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a client-server model?

A

A model of interaction in which a process sends a request to another process and awaits a response. The requesting process is called a client and the responding process is called a server. The client process is usually a web browser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are two terms that are frequently used to describe HTTP?

A

“Client-server model” and “stateless protocol”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does it mean that HTTP is a stateless protocol?

A

HTTP being a stateless protocol means each request-response pair is independent from other requests and responses. The server does not retain information about previous requests from the same client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the structure of a HTTP request?

A
  1. Request line
  2. Headers
  3. Body (optional)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does a HTTP request line contain?

A

The method of the request, the path of the requested resource, and the HTTP version used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Name some HTTP request methods

A
  1. GET - for requesting data from a resource without affecting the resource
  2. POST - for submitting data to a resource, resulting in a change on the server
  3. DELETE - for the deleting the specified resource
  4. PATCH - for applying partial modifications to a resource
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of HTTP request headers?

A

To provide metadata about the request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When does a HTTP request have a body?

A

When some data is sent to the server, eg when the request method is POST

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the structure of a HTTP response?

A
  1. Status line
  2. Headers
  3. Body
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does a HTTP response status line include?

A

The HTTP version, a status code, and a reason phrase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Name some HTTP response status codes and reason phrases

A
  1. 200 OK - request was successful
  2. 201 Created - request was successful and resource was created on the server
  3. 400 Bad Request - the server couldn’t understand the request
  4. 404 Not Found - the server couldn’t find the requested resource
  5. 500 Internal Server Error - an error occurred on the server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Name some examples of metadata provided in the HTTP response headers

A

Content-Type, Content-Length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe the steps of the HTTP communication process

A
  1. The client establishes a TCP connection to the server
  2. The client sends an HTTP request message to the server
  3. The server processes the request, retrieves the requested resource, and prepares a response
  4. The server sends the response to the client
  5. Unless persistent connection is used, the connection is closed
17
Q

What is HTTPS?

A

HTTPS stands for HTTP Secure and is an extension of HTTP that encrypts the data transmitted between client and server using TLS

18
Q

Name the different versions of HTTP

A

HTTP/0.9
HTTP/1.0
HTTP/1.1
HTTP/2
HTTP/3

19
Q

What year was each version of HTTP released?

A

HTTP/0.9 - 1991
HTTP/1.0 - 1996
HTTP/1.1 - 1997
HTTP/2 - 2015
HTTP/3 - 2022

20
Q

Describe HTTP/0.9

A

The first version of the protocol released in 1991. It was a very basic protocol for serving raw HTML content. The only supported request method was GET and there were no headers, only a simple request line. Responses had no status codes or metadata.

21
Q

Describe HTTP/1.0

A

The second version released in 1996. It introduced the concept of headers, allowing metadata to be sent with requests and responses. It also supported a couple more request methods, POST and HEAD, and introduced status codes and reason phrases (eg 200 OK). Each request-response pair required a separate TCP connection.

22
Q

Describe HTTP/1.1

A

Released in 1997 and still widely used today. Made persistent connections the default and introduced more request methods like PUT and DELETE. It also introduced chunked transfer encoding for sending data in pieces. It improved caching with headers like Cache-Control and introduced the Host header to support virtual hosting (ie multiple domains on a single IP address). It enhanced support for pipelining (sending multiple requests in a row without awaiting responses to previous requests)

23
Q

Describe HTTP/2

A

Released in 2015. Binary instead of text-based, improving parsing efficiency and reducing errors. It introduced multiplexing, allowing multiple requests and responses to be sent concurrently over a single connection. Header compression reduces overhead and improves performance. Server push enables servers to send resources proactively

24
Q

Describe HTTP/3

A

The most recent version, released in 2022. Uses QUIC instead of TCP, which makes it faster. Has built-in encryption with TLS as part of the protocol. Improved handling of packet loss and reduced latency. Continued support for HTTP/2 features like header compression

25
Q

Summarize the differences between different versions of HTTP

A

HTTP/0.9 - first bare-bones version
HTTP/1.0 - introduced headers, status codes, more methods
HTTP/1.1 - even more methods, persistent connections, chunked transfer encoding
HTTP/2 - binary protocol, multiplexing, header compression, server push, made many performance improvements
HTTP/3 - uses QUIC, has built-in encryption, is faster, more stable, and more secure