4. HTTP Flashcards

1
Q

What are the 2 general types of HTTP messages?

A

Request and response. Client’s browser (aka user agent) requests, receives and renders Web objects. Server sends objects in reponse to the requests.

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

What are the 4 common HTTP methods? Describe them.

A

GET: typically a request for a file.
HEAD: returns header information e.g last-modified date, size, content-type. Should be indentical to the header part of a GET response.
POST: submits user input usually from a form.
Conditional GET: Conditional fields include: If-Modified-Since, If-Match, If-Range. Requests that the entity be transferred ony under the circumstances described. Reduces unnecessary network usage by allowing cached entities to be refreshed without mutliple requests.

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

How does the conditional-GET request reduce network usage?

A

Reduces unnecessary network usage by allowing cached entities to be refreshed without mutliple requests

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

Describe both methods of uploading form input.

A

POST method - web page includes a form input, input is uploaded to server in entity body

URL method - uses GET method, input is uploaded in URL field of request line:
www.somesite.com/animalsearch?monkeys&banana

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

HTTP is stateless. What does this mean, and why is this an advantage?

A

This means that the server maintains no information about past client requests.
Protocols that maintain state are potentially complex:
- past history must be maintained
- if client/server crashes their views of state may be incosistent with the other and must be reconciled

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

What is the relationship between HTTP 1.0 and TCP?

A

HTTP 1.0 used a single TCP connection for each request/response transaction, so multiple transactions between the same client and server needed multiple TCP connections. HTTP 1.1 introduced means to keep the TCP connection open, reducing congestion. e.g keep-alive: 115/r/n

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

What are the 5 types of HTTP response codes?

A
1xx - Informational
2xx - Successful
3xx - Redirection
4xx - Client Error
5xx - Server Error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What can cookies be used for?

A
  • authorization
  • shopping carts
  • recommendations
  • user session state (http messages can carry state)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly