Web Requests - HTTP Headers Flashcards

1
Q

What are HTTP headers?

A

HTTP headers pass information between the client and the server.

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

List the categories of HTTP headers.

A
  • General Headers
  • Entity Headers
  • Request Headers
  • Response Headers
  • Security Headers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do General Headers describe?

A

General headers describe the message rather than its contents.

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

What is the purpose of the Date header?

A

Holds the date and time at which the message originated.

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

What does the Connection header dictate?

A

Dictates if the current network connection should stay alive after the request finishes.

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

What does the Content-Type header indicate?

A

Used to describe the type of resource being transferred.

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

What is the role of the Content-Length header?

A

Holds the size of the entity being passed.

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

Fill in the blank: Entity Headers are used to describe the _______ transferred by a message.

A

[content]

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

What does the Host header specify in a request?

A

Specifies the host being queried for the resource.

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

What information does the User-Agent header provide?

A

Describes the client requesting resources, including browser and operating system.

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

True or False: The Referer header indicates where the current request is coming from.

A

True

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

What does the Accept header describe?

A

Describes which media types the client can understand.

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

What is stored in the Cookie header?

A

Contains cookie-value pairs in the format name=value.

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

What does the Set-Cookie header do?

A

Contains the cookies needed for client identification.

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

What does the WWW-Authenticate header notify the client of?

A

Notifies the client about the type of authentication required to access the requested resource.

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

What is the purpose of Security Headers?

A

Specify certain rules and policies to be followed by the browser while accessing the website.

17
Q

What does the Content-Security-Policy header dictate?

A

Dictates the website’s policy towards externally injected resources.

18
Q

What does Strict-Transport-Security prevent?

A

Prevents the browser from accessing the website over the plaintext HTTP protocol.

19
Q

Fill in the blank: The Referrer-Policy header dictates whether the browser should include the value specified via the _______ header.

20
Q

What cURL flag is used to send a HEAD request and only display the response headers?

21
Q

What does the -i flag in cURL do?

A

Displays both the headers and the response body.

22
Q

What command shows how to set the User-Agent header using cURL?

A

curl https://www.inlanefreight.com -A ‘User-Agent’

23
Q

Where can you view HTTP headers in browser DevTools?

A

In the Network tab.

24
Q

What can you see in the Cookies tab of browser DevTools?

A

Any cookies used by the request.