Network Requests Flashcards

1
Q

Name some examples of Web APIs

A

DOM (document), AJAX (XMLHttpRequest), Timeout

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

What is a RESTful API and what are its fielding constraints?

A

1) The network must be made up of clients and servers. A non-RESTful alternative to client-server architecture is event-based integration architecture. In this model, each component continuously broadcasts events while listening for pertinent events from other components. There’s no one-to-one communication, only broadcasting and eavesdropping
2) Stateless- Stateless does not mean that servers and clients do not have state, it simply means that they do not need to keep track of each other’s state. When a client is not interacting with the server, the server has no idea of its existence. The server also does not keep a record of past requests. Each request is treated as a standalone.
3) Uniform interface- ensures that there is a common language between servers and clients that allows each part to be swapped out or modified without breaking the entire system. This is achieved by:
-identification of resources (each resource must be uniquely identified by a stable identifier),
-manipulation of resources through representations (client manipulates resources through sending representations to the server… usually JSON. The server takes the request as a suggestion, but still has ultimate control)
-self-descriptive messages (contains all the info the recipient needs to understand it)
-hypermedia- data from the server to client that contains info on what to do next (like links and buttons)
4) Caching, layered system- RESTful APIs are cacheable due to because of the self-descriptive messages. Layered system refers to the fact that there can be more components than just servers and clients. Each component is constrained to only see and interact with the very next layer. Example layers include proxies and gateways

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

What is the DOM?

A

The DOM is a Web API that allows developers to use programming logic to make changes to their HTML code. It’s a reliable way to make changes that turn static websites into dynamic ones.

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