HTTP Flashcards

1
Q

What does HTTP stand for?

A

Hyper Text Transfer Protocol.

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

What is the default port of HTTP?

A

80

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

What is HTTP?

A

Stateless protocol that defines how messages are formatted and transmitted, and what actions servers and clients should take in response to various commands.

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

What are 4 basic aspects of HTTP?

A
  1. Simple: simple and human readable.
  2. Extensible: through use of headers.
  3. Stateless (but not session-less): no limit between requests being carried with same connection. HTTP cookies allow for stateful sessions.
  4. Connections: Most commonly relies upon connection based TCP.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the three pillars of HTTP communication?

A
  1. URL structure.
  2. Verbs.
  3. Status codes.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the three basic components of HTTP based systems.

A
  1. Client
  2. Web server
  3. Proxies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the client component of an HTTP based system?

A

The “User-agent”. Any tool that acts on behalf of a user (browser, phone). Always initiates the request.

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

What is the web-server component of an HTTP based system?

A

The server which handles the request of the client.

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

What is the proxy component of HTTP based systems?

A
Machines operating at the application layer that relay HTTP messages.  
Functions include:
1. caching
2. filtering
3. load balancing
4. authentication
5. logging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the layers for HTTP?

A

HTTP, TCP, IP

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

What are the layers for HTTPS?

A

HTTP, SSL or TLS, TCP, IP

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

What made up http 1.0?

A
  • Building extensibility.
  • Versioning info sent with each request.
  • Status code sent in response.
  • HTTP headers introduced.
  • Transmission of more than HTML.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What made up HTTP 1.1?

A
  • Standardized protocol.
  • Connection reuse.
  • Pipelining: 2nd req made before 1st received.
  • Support for chunked responses.
  • Additional cache-control mechanisms.
  • Content negotiation between endpoints.
  • Server collocation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What makes up HTTP 2?

A
  • Greater performance.
  • Binary protocol: cannot be read/created manually.
  • Multiplexed: Parallel requests mad over the same connection.
  • Compressed headers: removes duplication.
  • Allows server to populate data in client cache in advance of being required.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What can be controlled by HTTP?

A
  • Cache
  • Relaxing origin constraint
  • Authentication
  • Proxy and tunneling
  • Sessions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the process for two endpoints for request and response?

A

CLIENT- resolve IP address from host name w/ DNS lookup.
CLIENT- establish connection with server.
CLIENT- send request to server.
CLIENT- wait for response.
SERVER- process request, send response.
CLIENT- receive response.
CLIENT- close connection.

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

What is HTTP flow from client perspective?

A
  1. Connect to server via TCP.
  2. Send HTTP message to server.
  3. Read response from server.
  4. Close or reuse connection for more requests.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the two types of HTTP messages?

A

request and response.

19
Q

What are the components of an HTTP request message?

A
  1. method, path, protocol version
  2. headers (optional)
  3. blank line
  4. body (optional)
20
Q

What are the components of an HTTP response message?

A
  1. protocol version, status code, status message
  2. headers (optional)
  3. blank line
  4. body (optional)
21
Q

What does URL stand for?

A

Uniform Resource Locator.

22
Q

What are the parts of a URL?

A

protocol, host, port, resource path, query

23
Q

What are the verbs used in HTTP?

A
GET
POST
PUT
DELETE
HEAD
TRACE
OPTIONS
24
Q

What does the GET verb indicate?

A

Fetch an existing resource?

25
Q

What does the POST verb indicate?

A

Create a new resource. Usually carries a payload that specifies the date for the new resource.

26
Q

What does the PUT verb indicate?

A

Update an existing resource. Payload may contain the data to update the resource.

27
Q

What does the DELETE verb indicate?

A

Delete an existing resource.

28
Q

What does the HEAD verb indicate?

A

Identical to GET except server must not send a message body in the response.

29
Q

What does the OPTION verb indicate?

A

Request for information about the communication options available on the request/response channel.

30
Q

What does the TRACE verb indicate?

A

Invoke a remote, application-layer loop-back of the request message.

31
Q

When is a request idempotent?

A

When a single execution of the entire sequence always yields a result that is not changed by a re-execution of all, or part, of that sequence.

32
Q

What methods are idempotent

A

GET, HEAD, PUT, DELETE. OPTIONS and TRACE should always be as well.

33
Q

What are the headers that are share between both request and response messages?

A
Cache-Control
Connection
Date
Pragma
Trailer
Transfer-Encoding
Upgrade
Via
Warning
34
Q

What are the entity headers?

A
Allow
Content-Encoding
Content-Language
Content-Length
Content-Location
Content-MD5
Content-Range
Content-Type
Expires
Last Modified
35
Q

What is an HTTP cookie?

A

Small piece of data a server sends to a users web browser. Typically used to tell if two requests came from the same browser. Remember stateful information.

36
Q

What are the three reasons to use cookies?

A
  1. Session management
  2. Personalization
  3. Tracking
37
Q

How is a cookie created?

A

With the Set-Cookie head in a server response message.

38
Q

What are different caches associated with HTTP?

A

Private cache: Dedicated to a single user. Holds all docs downloaded via HTTP by the user.
Shared Proxy Caches: Shared cache that stores responses to be used by more than one user.

39
Q

What is the header used in request messages to define caching policies?

A

Cache-Control

40
Q

What is the web-storage API?

A

A mechanism by which browsers can store key/value pairs in a more intuitive way than cookies.

41
Q

What is Session storage in web-storage?

A

Storage for browser that maintains a separate area for each origin thats available for the duration of the page session.

42
Q

What is Local storage in web-storage?

A

Same as Session storage but persists even when browser is closed.

43
Q

What is the answer to minimizing network delays and creating a smooth experience for the client?

A

Parallel connections in combination with persistent connections.