Web Requests - HTTP Headers Flashcards
What are HTTP headers?
HTTP headers pass information between the client and the server.
List the categories of HTTP headers.
- General Headers
- Entity Headers
- Request Headers
- Response Headers
- Security Headers
What do General Headers describe?
General headers describe the message rather than its contents.
What is the purpose of the Date header?
Holds the date and time at which the message originated.
What does the Connection header dictate?
Dictates if the current network connection should stay alive after the request finishes.
What does the Content-Type header indicate?
Used to describe the type of resource being transferred.
What is the role of the Content-Length header?
Holds the size of the entity being passed.
Fill in the blank: Entity Headers are used to describe the _______ transferred by a message.
[content]
What does the Host header specify in a request?
Specifies the host being queried for the resource.
What information does the User-Agent header provide?
Describes the client requesting resources, including browser and operating system.
True or False: The Referer header indicates where the current request is coming from.
True
What does the Accept header describe?
Describes which media types the client can understand.
What is stored in the Cookie header?
Contains cookie-value pairs in the format name=value.
What does the Set-Cookie header do?
Contains the cookies needed for client identification.
What does the WWW-Authenticate header notify the client of?
Notifies the client about the type of authentication required to access the requested resource.
What is the purpose of Security Headers?
Specify certain rules and policies to be followed by the browser while accessing the website.
What does the Content-Security-Policy header dictate?
Dictates the website’s policy towards externally injected resources.
What does Strict-Transport-Security prevent?
Prevents the browser from accessing the website over the plaintext HTTP protocol.
Fill in the blank: The Referrer-Policy header dictates whether the browser should include the value specified via the _______ header.
[Referer]
What cURL flag is used to send a HEAD request and only display the response headers?
-I
What does the -i flag in cURL do?
Displays both the headers and the response body.
What command shows how to set the User-Agent header using cURL?
curl https://www.inlanefreight.com -A ‘User-Agent’
Where can you view HTTP headers in browser DevTools?
In the Network tab.
What can you see in the Cookies tab of browser DevTools?
Any cookies used by the request.