HTTP Flashcards
What is a client?
service requesters
What is a server?
providing resources or service
program or device that receives request to send service
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?
HTTP methods like verbs (GET, PUT, POST) or nouns (HEAD or OPTIONS)
- GET –> resource should be fetched
- POST –> data is pushed to the server
request Target –> URL
HTTP version
method
request-target
HTTP version
What is on the first line of an HTTP request message?
GET horses HTTP/1.1
HTTP method, request-target, protocol version
it will return as the HTTP/1.1 version
What is on the first line of an HTTP response message?
HTTP/1.1 200 OK:
protocol version, status code, status text
What three things are on the start-line of an HTTP response message?
protocol version usually HTTP/1.1
status code –> success or failure of the request –> 200, 404, 302
status text –> brief, purely informational, textual description of the status code
What are HTTP headers?
additional information to describe the request or response being made - metadata
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?
No
What is AJAX?
update the document dynamically which means you don’t need to load the page
allowing to collect of data to update parts of the DOM of an HTML page without the need for a full page refresh
What does the AJAX acronym stand for?
Asynchronous JavaScript And XML
Which object is built into the browser for making HTTP requests in JavaScript?
XMLHttpRequest
‘What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
‘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?
they have the shared prototype