HTTP Flashcards
What is a client?
a service requester of a server
What is a server?
a service provider, providing web pages or files to clients
Which HTTP method does a browser issue to a web server when you visit a URL?
GET request
What three things are on the start-line of an HTTP request message?
1.HTTP method (GET, POST), 2.Request target (URL, path), 3.HTTP version protocol
examples: POST / HTTP/1.1
GET /background.png HTTP/1.0
What three things are on the start-line of an HTTP response message?
- Protocol version (HTTP/1.1), 2.Status code (200, 404, 302), 3.Status text
example: HTTP/1.1 404 Not Found.
What are HTTP headers?
a header is a string followed by a colon with a value, which allows the client and server to pass additional information with an HTTP request or response
Is a body required for a valid HTTP request or response message?
no, it’s optional
What is AJAX?
the practice of building complex, dynamic webpages using XMLHttpRequest
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
An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?
both are chained on the EventTarget prototype