HTTP Flashcards
what is a client?
In computing, a client is a piece of computer hardware or software that accesses a service made available by a server as part of the client-server model of computer networks.
what is a server?
a server is a piece of computer hardware or software that provides functionality for other programs or devices, called ‘clients’.
Servers can provide various functionalities, often called “services”, such as sharing data or resources among multiple clients, or performing computation for a client.
Which HTTP method does a browser issue to a web server when you visit a URL?
GET
What three things are on the start-line of an HTTP request message?
An HTTP method
an request target
HTTP version
What three things are on the start-line of an HTTP response message?
Status line, header and body
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. Whitespace before the value is ignored.
=> metadata about the request or response
Where would you go if you wanted to learn more about a specific HTTP Header?
mdn
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. Some requests send data to the server in order to update it: as often the case with POST requests (containing HTML form data).
Not all responses have one: responses with a status code that sufficiently answers the request without the need for corresponding payload (like 201 Created or 204 No Content) usually don’t.
what is on the first line of an HTTP request message?
HTTP method, request target(usually a URL or the absolute path of the protocol, port and domain), HTTP version
what is on the first line of an HTTP response message?
The protocol version (HTTP/1.1)
A status code (404)
A status text (Not Found)