HTTP & Friends Flashcards
What is the main issue with FTP
FTP is outdated, lacks security, and uses multiple connections for control and data transfer, which complicates setups. It also doesn’t encrypt data, making it vulnerable to attacks.
Why was FTP originally designed
FTP was designed to standardize file transfers between systems with different file structures and character sets. It solved issues with inconsistent and incompatible transfer methods before a universal protocol existed.
What is one advantage of FTP
FTP decouples path names, allowing clients to access files without knowing the server’s exact file system layout. This flexibility makes it easier to adapt to different environments and manage files across various systems.
How many connections does FTP require at a minimum
FTP requires a minimum of three connections: one for the control channel to send commands, and two for data transfer (one for uploading and one for downloading). This setup ensures commands and data are managed separately, but it increases complexity compared to protocols that use a single connection.
What is the key difference between FTP and HTTP
FTP requires multiple connections while HTTP uses a single connection
What does the HTTP HEAD method do
It retrieves metadata without downloading the entire file
Why is caching used in HTTP
To serve static content faster and reduce server load
What does the Accept flag in HTTP specify
The Accept flag in HTTP specifies the content types (e.g., text/html, application/json) that the client can process. This helps the server deliver responses in a format the client supports.
What is the purpose of the Content-Length header
The Content-Length header specifies the size of the response body in bytes. This helps the client know when the response ends, ensuring proper parsing of the content.
What is HSTS and why is it important
HSTS (HTTP Strict Transport Security) enforces the use of HTTPS by ensuring all connections to a website are encrypted. It protects users from downgrade attacks and prevents unencrypted connections, improving security against man-in-the-middle attacks.
Why should JSON and POST be used for remote services
To avoid security issues like length extension attacks.
POST allows securely sending data in the request body, and JSON provides a structured format resistant to injection vulnerabilities.
What is the primary role of an HTTP User-Agent
To identify the client software making the request.
This helps the server customise responses based on the client’s capabilities or requirements.
What is the purpose of the ETag header
The ETag header uniquely identifies a resource on the server and checks if it has been modified.
It helps optimise caching by allowing clients to determine whether they need to download the resource again.
What is the difference between GET and POST in HTTP
GET retrieves data while POST sends data to the server
What is HTTP Basic Auth
An insecure method of sending credentials encoded in Base64
Why should HTTPS be used instead of HTTP
To encrypt data and ensure secure communication
What does the Accept-Encoding header indicate
The compression formats the client can handle
Why is Accept-Ranges useful
It allows downloading specific parts of a file
What is the main benefit of keep-alive connections
They enable multiple requests over a single connection improving performance
What is the significance of HTTP status codes
They indicate the result of an HTTP request
What are the categories of HTTP status codes
1xx informational 2xx success 3xx redirection 4xx client error 5xx server error
What is the main issue with HTTP Basic Auth
It sends credentials insecurely without encryption
Why are cookies considered a security risk
They can be abused to store sensitive client-side data
What is the purpose of the Set-Cookie header
To store a key-value pair for future requests to the same domain
Why is caching on inbound servers useful
Improves response times, reduces backend load, scales better for high traffic, and avoids redundant processing of identical requests.
What is the function of proxy_pass in HTTP servers
To route requests to a specified backend server
What is the purpose of the Host header in HTTP
It allows multiple virtual servers to share the same IP address by distinguishing incoming requests based on the Host value
Why should cookies only store a session ID
To avoid exposing sensitive information client-side