HyperText Transfer Protocol (HTTP) Flashcards

1
Q

HTTP is stateless, what does that mean?

A

The server does not know the previous HTTP request

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

In HTTP everything is sent and received in…

A

Clear text

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

HTTPS

A

HTTP over a secured TLS connection (HTTPS)

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

HTTP request content

A

HTTP Method -> GET, PUT, PATCH, POST, DELETE

Target -> URL

Protocol Version -> HTTP/1.1, HTTP/2

Headers -> meta information

Body -> data

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

HTTP Request Header Fields

A

Accept -> what kind of response resource type to accept

User-Agent -> the product sending the request

Cookie -> Sends a cookie to the server

Authorization -> Authorization method and credentials…

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

HTTP Response content

A

Protocol Version -> HTTP/1.1, HTTP/2

Status Code -> e.g., 200, 404

Status Text -> e.g., OK, Not Found

Headers -> meta information

Body -> e.g., the requested resource or an error page

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

HTTP Response Header Fields

A

Age: estimate of seconds since the response was generated

Expires: at what date/time is the response considered “stale” (=outdated)

Allow: list of http methods allowed for this resource

Content-Type: media type of the resource

Set-Cookie: saves a cookie on client side

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

What does URL stand for?

A

Uniform Resource Locator

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

HTTP Methods (Verbs)

A

9 different kinds of requests

Common:
GET -> request a representation of the specified resource

POST-> submit an entity to the specified resource

PUT-> replaces the target resource with the request payload

PATCH-> apply partial modifications to a resource

DELETE-> Delete the specified resource

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

HTTP Method Properties

A

Safe -> Does not cause any side effect on the server(GET)

Idempotent-> the effect on the server is the same, no matter how many times it is executed (DELETE, PUT)

Cacheable-> the response to the request can be stored for future re-use (GET, POST)

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

HTTP response codes

A
1xx -> Informational
2xx -> Success
3xx -> Redirection
4xx -> Client error
5xx -> Server error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Cookies

A

NOT EVIL >:)
Text saved on the client side (in browser)

The server sets the cookie, the client returns it

Can be modified

Can be deleted

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