http Flashcards

(44 cards)

1
Q

What does HTTP stand for?

A

HyperText Transfer Protocol.

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

What are the main roles in HTTP?

A

Client (browser) requests and displays web objects; Server sends objects in response.

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

Which RFCs define HTTP/1.0 and HTTP/1.1?

A

HTTP/1.0: RFC 1945, HTTP/1.1: RFC 2068.

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

What is the structure of an HTTP request message?

A

Request line (method, URL, version), header lines, and an optional entity body.

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

Is an HTTP request human-readable?

A

Yes, it’s ASCII text format.

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

What marks the end of an HTTP message?

A

A blank line (carriage return + line feed).

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

List the common HTTP methods.

A

GET, POST, HEAD, PUT, DELETE.

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

What does the GET method do?

A

Retrieves a file specified in the URL path.

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

What does the POST method do?

A

Sends data enclosed in the entity body as input to the specified resource.

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

What does the HEAD method do?

A

Requests headers only (no body) to check metadata.

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

What does the PUT method do?

A

Uploads a file in the entity body to the path specified in the URL.

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

What does the DELETE method do?

A

Deletes the file or resource specified in the URL field.

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

How is input uploaded using the GET method?

A

As parameters encoded into the URL field.

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

How is input uploaded using the POST method?

A

As data in the request’s entity body.

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

What does a sample HTTP POST request include?

A

A request line, headers (Host, Content-type, etc.), and form data in the body (e.g., Account=…&State=…).

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

What is the structure of an HTTP response?

A

Status line (version, status code, phrase), header lines, and data (body).

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

Give an example of a status line.

A

HTTP/1.1 200 OK.

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

List common HTTP status codes.

A

200 OK, 301 Moved Permanently, 400 Bad Request, 404 Not Found, 505 HTTP Version Not Supported.

19
Q

What does status code 200 mean?

A

Request succeeded; the requested object follows in the message.

20
Q

What does status code 301 mean?

A

The requested object has been moved; new location is in the Location header.

21
Q

What does status code 400 mean?

A

Bad Request — the message could not be understood by the server.

22
Q

What does status code 404 mean?

A

Not Found — the requested document doesn’t exist on the server.

23
Q

What does status code 505 mean?

A

HTTP Version Not Supported — the server doesn’t support the HTTP version used.

24
Q

What port does HTTP use?

A

Port 80 by default.

25
What is a persistent connection in HTTP?
Multiple objects can be sent over one TCP connection between client and server (default in HTTP/1.1).
26
What is a nonpersistent connection?
At most one object per TCP connection (used by HTTP/1.0).
27
What are drawbacks of nonpersistent connections?
Requires 2 RTTs per object; browsers may open parallel TCP connections to compensate.
28
What is RTT in HTTP performance?
Round-Trip Time — time to send a small packet to a server and back.
29
What is the formula for total response time in HTTP?
2 × RTT + transmission time.
30
Is HTTP stateless?
Yes, servers keep no record of past requests.
31
What are cookies used for in HTTP?
To maintain user-server state across requests (e.g., sessions, shopping carts, recommendations).
32
What are first-party cookies?
Cookies from the website you directly visit.
33
What are third-party cookies?
Cookies set by domains other than the one you visited (often used for tracking).
34
How can cookies be used to track users?
Third-party ad domains can correlate cookies across sites to track browsing behavior.
35
What is a web cache or proxy server?
An intermediary server that stores copies of objects to reduce client response time and save bandwidth.
36
What happens on a cache hit?
The cache returns the object directly to the client.
37
What happens on a cache miss?
The cache requests the object from the origin server, stores it, and forwards it to the client.
38
What is the purpose of a Conditional GET?
To ensure cached content is up-to-date while minimizing unnecessary transfers.
39
What are the main drawbacks of HTTP/1.1?
Requests are sequential, causing backlog and delays with multiple page objects.
40
How does HTTP/2 improve over HTTP/1.1?
Uses multiplexing — all requests share a single connection and can be processed concurrently.
41
What is HTTP/2’s frame structure?
Frames include length, type, flags, stream ID, and data; frames are grouped into streams and messages.
42
What is a stream in HTTP/2?
A bidirectional flow of bytes between client and server identified by a stream ID.
43
What are HTTP/2’s key goals?
Reduce latency with multiplexing, header compression, prioritization, and server push.
44
What does HTTP/3 use instead of TCP?
UDP-based QUIC transport protocol.