HTTP Flashcards
What is a client?
A computer that accesses a service(s) provided by a server.
What is a server?
A computer provides a service(s) to one or more clients.
Which HTTP method does a browser issue to a web server when you visit a URL?
The GET method.
What three things are on the start-line of an HTTP request message?
- The HTTP method (i.e., GET, PUT, POST, etc.)
- The request target (usually a URL)
- The HTTP version
What three things are on the start-line of an HTTP response message?
- The protocol version (i.e., HTTP/1.1)
- A status code (i.e., 200, 404, 302)
- A status text (a description of the status code)
What are HTTP headers?
They allow the client and the server pass additional information with an HTTP request or response.
Where would you go if you wanted to learn more about a specific HTTP Header?
MDN Web Docs.
Is a body required for a valid HTTP request or response message?
No because not all responses have one.
What is AJAX?
AJAX allows data requests from a server to load on a webpage without refreshing.
What does the AJAX acronym stand for?
Asynchronous JavaScript and XML.
Which object is built into the browser for making HTTP requests in JavaScript?
The XMLHTTPRequest() object.
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
The load event.
Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?
XMLHttpRequest shares a prototype with Dom elements.