HTTP Flashcards
HTTP-MESSAGES
What is a client?
A client is a service requester within a client-server model.
- A client usually does not share any of its resources, but it requests content or service from a server.
- Clients, therefore, initiate communication sessions with servers, which await incoming requests
HTTP-MESSAGES
What is a server?
A server is the provider(s) of a resource or service within a client-server model.
- A server host runs one or more server programs, which share their resources with clients.
HTTP-MESSAGES
Which HTTP method does a browser issue to a web server when you visit a URL?
A complete URL, known as the absolute form, is mostly used with GET when connected to a proxy.
Example:
GET https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages HTTP/1.1
HTTP-MESSAGES
What three things are on the start-line of an HTTP request message?
- An HTTP method (verb like GET PUT POST or noun like HEAD OPTIONS) that describes the action to be performed.
- The request target, usually a URL, or the absolute path of the protocol, port, and domain are usually characterized by the request context.
- The HTTP version, which defines the structure of the remaining message, acting as an indicator of the expected version to use for the response.
HTTP-MESSAGES
What three things are on the start-line of an HTTP response message?
- The protocol version, usually HTTP/1.1.
- A status code, indicating success or failure of the request. Common status codes are 200, 404, or 302
- A status text. A brief, purely informational, textual description of the status code to help a human understand the HTTP message.
HTTP-MESSAGES
What are HTTP headers?
HTTP headers let the client and the server pass additional information with an HTTP request or response. An HTTP header consists of its case-insensitive name followed by a colon (:), then by its value.
HTTP-MESSAGES
Where would you go if you wanted to learn more about a specific HTTP Header?
MDN
HTTP-MESSAGES
Is a body required for a valid HTTP request or response message?
Not all requests have one: requests fetching resources, like GET, HEAD, DELETE, or OPTIONS, usually don’t need one.