HTTP Flashcards

1
Q

What is a client?

A

computer/software/anything that requests a service and consume data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a server?

A

computer/software/anything that provide resource or service

ex) web server, file server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which HTTP method does a browser issue to a web server when you visit a URL?

A

GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What three things are on the start-line of an HTTP request message?

A
  1. HTTP method = a verb (like GET, PUT or POST) or a noun (like HEAD or OPTIONS), that describes the action to be performed.
  2. request target (usually a URL, or the absolute path of the protocol, port, and domain are usually characterized by the request context)
  3. HTTP version, which defines the structure of the remaining message, acting as an indicator of the expected version to use for the response
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What three things are on the start-line of an HTTP response message?

A
  1. protocol version aka HTTP version, usually HTTP/1.1.
  2. status code indicating success or failure of the request. Common status codes are 200, 404, or 302
  3. status text, a brief, textual description of the status code to help a human understand the HTTP message
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are HTTP headers?

A

equivalent of head element in HTML document but for HTTP
attaching metadata/additional information that describes the data itself (several types: general, request, representation)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Where would you go if you wanted to learn more about a specific HTTP Header?

A

MDN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Is a body required for a valid HTTP request or response message?

A

No.

The final part of the request is its body. Not all requests have one: requests fetching resources, like GET, HEAD, DELETE, or OPTIONS, usually don’t need one. Some requests send data to the server in order to update it: as often the case with POST requests (containing HTML form data).

Bodies can be broadly divided into two categories:

  • Single-resource bodies, consisting of one single file, defined by the two headers: Content-Type and Content-Length.
  • Multiple-resource bodies, consisting of a multipart body, each containing a different bit of information. This is typically associated with HTML Forms.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is AJAX?

A

Asynchronous meaning your code continues to run while the targeted part of your web page is trying to reload (compared to synchronously, which blocks your code from running until that part of your page is done reloading)

A programming practice of building complex, dynamic webpages using a technology known as XMLHttpRequest.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the AJAX acronym stand for?

A

Asynchronous JavaScript And XML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which object is built into the browser for making HTTP requests in JavaScript?

A

XMLHttpRequest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?

A

‘load’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?

A

prototypal inheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

http vs https

A

s = secure

making it not visible and therefore more “secure”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly