Introducing API Flashcards
What is a REST API?
a programming interface that communicates over http while adhering to the principles of the REST architectural style
What are the six principles of the REST architecture style
Client-Server Stateless Cache Uniform Interface Layered System Code-On-Demand (Optional)
What are the protocols of HTTP
HTTP requests/responses
HTTP verbs
HTTP status codes
HTTP headers/body
What are the four major componets of an API
Uniform Resource identifier (URI)
Http method
Header
Body
What is a Uniform Resource identifier (URI) or Uniform Resource Locator (URL)
identifes which resource the client wants to manipulate
What is the syntax of a URL
Scheme
Authority
Path
Query
What is a scheme in a URL
Specifies which HTTP protocol should be used
What are the two options for scheme in a url
http
https
What are the three reasons for using API
Automaton tasks
Data integration
Functionality
What is a benefit of syncrhonous API design
enables the app to receive data immediately
What is a con of synchronous design
Bottlenecks can occur because of waiting for data to come
What is a Remote Procedure Call (RPC)
a request-response model that enables an application to make a procedure call to another app
How does RPC work
client is usually unaware that the procedure request is being executed remotely because the request is made to a layer that hides those details. As far as the client is concerned, these procedure calls are simply actions that it wants to perform. In other words, to a client, a Remote Procedure Call is just a method with arguments and when it’s called, the method gets executed and the results get returned.
What is Simple Object Access Protocol (SOAP)
a messaging protocol for communicating between applications that may be on different platforms or built with different programming languages. It is an XML-based protocol that was developed by Microsoft.
What are the three characteristics of SOAP
independent
Extensible
Neutral
What is REpresentational State Transfer (REST)
A modern type of API
Name the six constraints applied to elements with the architecture
Client-Server Stateless Cache Uniform Interface Layered System Code-On-Demand
Describe Client-Server of RESTFUL api
The client and server should be independent of each other, enabling the client to be built for multiple platforms and simplifying the server side components.
Describe Stateless constraint of an RESTFUL api
Requests from the client to the server must contain all of the information the server needs to make the request. The server cannot contain session states.
Describe the CACHE constraint of RESTFUL api
Responses from the server must state whether the response is cacheable or non-cacheable. If it is cacheable, the client can use the data from the response for later requests.
Describe the Layered system contraint in RESTFUl api
The system is made up of different hierarchical layers in which each layer provides services only to the layer above it. As a result, it consumes services from the layer below.
Describe Code-on-demand constraint in RESTFUl api
references the fact that information returned by a REST service can include executable code (e.g., javascript) or links to such code, intended to usefully extend client functionality.