Learning REST APIs Flashcards
Learn the basics of REST APIs. Discover what they are, why they matter, and how putting REST APIs to use can help you build faster, more efficient applications.
What does REST stand for
Representational State Transfer
What does API stand for
Application Programing Interface
What is REST?
Representational State Transfer refers to a group of software architecture design constraints that bring about efficient, reliable, and scalable systems
A representational state is transferred as a ____ which means the website doesn’t have to reload the whole page
Data Object (As opposed to having to load the new pages whole set of HTML Code)
What is an API
A set of features and rules that exist inside a software program enabling interaction between the software and other items, such as other software or hardware
what is the collection of tools used to access and work with REST resources?
API (Application Programming Interface)
What does URI stand for?
Universal Resource Identifier
What is a URI?
“A compact sequence of characters that identifies an abstract or physical resource” that “provides a simple and extensible means for identifying a resource”
What is the most generic way to name and locate a web resource?
URI?
What does URL Stand for?
Subset of the URI that identifies a resource and explains how to access that resource (https:// or ftp://)
What does URN stand for?
Universal Resource Name
What is a URN? How is that different from a URL?
Its the unique name of a URI. The URL includes the location which is not part of the URN.
What are the Six Constraints of REST
- Client - server architecture
- Statelessness
- Cacheability
- Layered system
- Code on demand
- Uniform interface
REST Constraint: Client - server architecture
This constraint ensures proper separation of concerns. The client manages user interface concerns while the server manages data storage concerns
REST Constraint: Statelessness
No client context or information, aka “state”, can be stored on the server between requests.
REST Constraint: Cacheability
All REST responses must be clearly marked as cacheable or not cacheable
REST Constraint: Layered system
The client cannot know, and shouldn’t care, whether it’s connected directly to the server or to an intermediary like a CDN or mirror
REST Constraint: Code on demand
Servers are allowed to transfer executable code like JavaScript and compiled components to clients
REST Constraint: Uniform interface
6.1 Resource identification in request
The URI request must specify what resource it is looking for and what format the response should use
6.2 Resource manipulation through representations
Once a client has a representation of a resource, it can modify or delete the resource
6.3 Self-descriptive messages
Self descriptive messages (messages must identify their format so they can be parsed
6.4 Hypermedia as the engine of application state
Once a client has access to a REST service, it should be able to discover all available resources and methods through the hyperlinks provided
who are the clients that consume the REST API?
This is the website or app that sends the request and parses the response
What is reqres.in?
This is a website that allows REST messages to be sent and will return data in order to allow users to test
What is a “resource” in REST
Any information that can be named can be a resource such as a document or image, a temporal service, a collection of other resources, a non-virtual object and so on
what does a REST server generate for clients upon request?
A representation of the requested resource. This allows multiple clients to access the same data at the same time
what are HTTP methods?
These are the commands (verbs) used to interact with the server. Such as using GET to retrieve information from the resource