HTTP Flashcards
What is a client?
A “service requester” in the client-server model; a program on a computer that requests data from a server
What is a server?
The provider of a resource or service in the client-server model; a program on a computer that provides data to clients that request it
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?
The HTTP method (e.g. GET, POST), the request target (URL), and the HTTP version
What three things are on the start-line of an HTTP response message?
The protocol version (usually HTTP/1.1), the status code (e.g. 200, 404), and the status text
What are HTTP headers?
Lines of code that contain the meta data of an HTTP request or response
Is a body required for a valid HTTP request or response message?
No
What does fetch() return?
A Promise that resolves into a Response object modeling the response of the http request
What is the default request method used by fetch()?
GET
How do you specify the request method (GET, POST, etc.) when calling fetch?
In the 2nd argument, provide an object with the property method: 'GET'