HTTP Flashcards
What is a client?
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”.
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
The request target
The HTTP version
What three things are on the start-line of an HTTP response message?
The Protocol version, usually HTTP/1.1
A status code
A status text
What are HTTP headers?
HTTP Headers are information about the request being made.
Where would you go if you wanted to learn more about a specific HTTP header?
MDN HTTP Headers.
Is a body required for a valid HTTP request or response message?
No.
What is on the first line of an HTTP request message?
An HTTP Method
The request target
The HTTP versoin
What is on the first line of an HTTP response message?
The protocol version, usually HTTP/1.1
A status code
A status text (human translation of the code)
What does fetch() return?
A promise that resolves to a Response object.
What is the default request method used by fetch()?
GET
How do you specify the request method (GET, POST, etc.) when calling fetch?
Use the init object. const init = { method: headers: mode: cache: }
When does React call a component’s componentDidMount method?
componentDidMount() is invoked immediately after a component is mounted (inserted into the tree).
Name three React.Component lifecycle methods.
constructor -> render -> componentDidMount().
componentDidMount()
componentWillUnmount()
componentDidUpdate()