What does HTTP stand for?
Hypertext Transfer Protocol — stateless application-level protocol.
Difference between HTTP/1.1, HTTP/2, HTTP/3?
1.1 = text, one request per connection; 2 = binary, multiplexing, header compression; 3 = like 2 but over QUIC/UDP.
Safe & cacheable HTTP method?
GET.
HTTP method used for actions, not cacheable, can cause side effects?
POST.
URL components?
scheme://authority/path?query#fragment
Is HTTP stateful or stateless?
Stateless — each request is independent.
What does the Host header specify?
Requested domain/authority.
What does the Accept header specify?
Content types the client prefers (e.g., text/html).
What does the Content-Type header specify?
MIME type of body (e.g., application/json).
What does the Set-Cookie header do?
Server asks client to store cookie.
Cache-Control: no-store means?
Don’t cache response anywhere.
What does the User-Agent header contain?
Client software info (browser name/version).
Accept-Encoding header means?
Compression formats client supports (e.g., gzip).
What is the ETag header?
Identifier for resource version (used with caching).
What does the Location header do?
New URL for redirects.
What does the Referer header show?
URL of page that triggered the request.
Difference between If-Modified-Since and If-None-Match?
IMS = date/time check, INM = ETag check for cache validation.
What does Connection: keep-alive mean?
Persistent HTTP/1.1 connection reused for multiple requests.
HTTP status 200?
OK — request successful.
HTTP status 301 vs 302 vs 303?
301 = moved permanently, 302 = temporary redirect, 303 = see other (GET next).
HTTP status 304?
Not Modified — use cached copy.
HTTP status 400 / 403 / 404 / 500?
Bad request / Forbidden / Not found / Server error.
Purpose of cookies?
Maintain state across stateless HTTP requests.
Secure cookie attribute?
Send cookie only over HTTPS.