HTTP Protocol Fundamentals

Understanding HTTP methods, status codes, headers, and request-response cycle in web communications

Category
Web Development
Level
basic
Languages
en → en
Cards
44
Markdown
HTTP Protocol Fundamentals (.md)

Flashcards (44)

#Front (Term / Question)Back (Definition / Answer)ExampleMultiple-Choice Options
1What does the POST method do?The POST method sends data to a server to create or update a resource.
2What is the role of the HTTP status code 204?A 204 status code indicates that the server successfully processed the request but is not returning any content.
3What is the role of the HTTP status code 408?A 408 status code indicates that the server timed out waiting for the client's request.
4What is the 'User-Agent' header?The 'User-Agent' header identifies the client software making the request to the server.
5What is the purpose of the PUT method?The PUT method updates an existing resource or creates a new resource if it does not exist.
6What is the purpose of the 'Origin' header?The 'Origin' header indicates the origin of the request, which is useful for CORS (Cross-Origin Resource Sharing) policies.
7What is the purpose of the 'Authorization' header?The 'Authorization' header contains credentials for authenticating the client with the server.
8What does a 404 status code indicate?A 404 status code indicates that the requested resource could not be found on the server.
9What is an HTTP status code?An HTTP status code is a three-digit number returned by a server to indicate the outcome of a client's request.
10What is a cookie in HTTP?A cookie is a small piece of data stored on the client side that is sent to the server with HTTP requests.
11What is the purpose of the 'Host' header?The 'Host' header specifies the domain name of the server and the port number on which the server is listening.
12What does the DELETE method do?The DELETE method removes a specified resource from the server.
13What is the purpose of the 'If-Modified-Since' header?The 'If-Modified-Since' header allows a client to request a resource only if it has been modified since a specified date.
14What is the purpose of the 'Connection' header?The 'Connection' header controls whether the network connection stays open after the current transaction finishes.
15What does HTTP stand for?HTTP stands for Hypertext Transfer Protocol.
16What is the purpose of the 'Accept-Encoding' header?The 'Accept-Encoding' header specifies the content encoding (like gzip) that the client can understand.
17What is a URI?A URI (Uniform Resource Identifier) is a string that identifies a resource on the internet.
18What does a 500 status code indicate?A 500 status code indicates an internal server error occurred while processing the request.
19What is the purpose of HTTP headers?HTTP headers provide additional information about the request or response, such as content type, length, and caching policies.
20What is the 'Content-Type' header used for?The 'Content-Type' header specifies the media type of the resource being sent or requested.
21What is the purpose of the 'Content-Disposition' header?The 'Content-Disposition' header indicates if the content should be displayed inline in the browser or treated as an attachment.
22What are HTTP methods?HTTP methods are commands that indicate the desired action to be performed on a resource, such as GET, POST, PUT, DELETE.
23What is a client in the context of HTTP?A client is typically a web browser or application that sends requests to a server.
24What is the difference between a GET request and a POST request?A GET request retrieves data without modifying it, while a POST request sends data to the server to create or update a resource.
25What is a redirect in HTTP?A redirect is an HTTP response that instructs the client to request a different URL.
26What is the role of the HTTP status code 301?A 301 status code indicates that a resource has been permanently moved to a new URL.
27What is the purpose of the 'Content-Length' header?The 'Content-Length' header indicates the size of the body of the request or response in bytes.
28What is a 403 status code?A 403 status code indicates that the server understands the request but refuses to authorize it.
29What is the difference between HTTP and HTTPS?HTTPS is HTTP with an added layer of security using SSL/TLS to encrypt the data transmitted.
30What is the HTTP request-response cycle?The HTTP request-response cycle is the process where a client sends a request to a server, and the server processes it and sends back a response.
31What is a server in the context of HTTP?A server is a system that hosts web applications and responds to client requests.
32What is the role of the HTTP status code 302?A 302 status code indicates that a resource has been temporarily moved to a different URL.
33What does a 200 status code indicate?A 200 status code indicates that the request was successful and the server returned the requested data.
34What is the role of the HTTP status code 429?A 429 status code indicates that the user has sent too many requests in a given amount of time.
35What is the purpose of the 'Accept' header?The 'Accept' header indicates the media types that the client is willing to receive from the server.
36What is the difference between persistent and non-persistent connections?Persistent connections allow multiple requests and responses to be sent over a single connection, while non-persistent connections close after each request/response pair.
37What does the GET method do?The GET method retrieves data from a server without modifying it.
38What is the primary purpose of HTTP?The primary purpose of HTTP is to facilitate communication between clients and servers on the web.
39What is a web API?A web API is an interface that allows different software applications to communicate over the web using HTTP.
40What is the difference between HTTP/1.1 and HTTP/2?HTTP/2 introduces multiplexing, header compression, and binary framing, improving performance over HTTP/1.1.
41What is the role of the HTTP status code 511?A 511 status code indicates that the client needs to authenticate to gain network access.
42What is the purpose of the 'Cache-Control' header?The 'Cache-Control' header specifies directives for caching mechanisms in both requests and responses.
43What is the purpose of the 'ETag' header?The 'ETag' header provides a unique identifier for a specific version of a resource, allowing for efficient caching.
44What is the purpose of the 'Referer' header?The 'Referer' header indicates the URL of the webpage that linked to the resource being requested.