| Web API type | Description | Type | 
|---|---|---|
| REST | Follows REST architecture | RESTful | 
| SOAP | Utilizes XML, strict standards | Non-RESTful | 
| GraphQL | Flexible query language | Non-RESTful | 
| 
    Web
   API  | 
   
    REST
   API  | 
  |
| 
   What
  they are  | 
  
   Web
  APIs encompass any API using HTTP or HTTPS. All REST APIs are Web APIs, but
  not all Web APIs are RESTful.  | 
  
   REST
  APIs are Web APIs that follow specific architectural principles like
  statelessness and client-server architecture.  | 
 
| 
   State  | 
  
   Technically,
  they can be stateless or stateful.  | 
  
   Statelessness
  implies that between sessions of API invocation, the server that hosts the
  program doesn’t need to ‘remember’ or hold any information between sessions
  to perform the appropriate action.  | 
 
| 
   When to
  choose  | 
  
   Non-RESTful
  Web APIs are used for stateful operations, ACID-compliant transactions with a
  web server, and working with legacy systems.  | 
  
   Statelessness
  is the main consideration when choosing RESTful APIs over non-RESTful APIs.  | 
 
| 
   Common
  use case  | 
  
   Many
  legacy systems, especially those that communicate with systems such as
  hardware or IoT devices, also use non-REST-based APIs.  | 
  
   RESTful
  APIs are often used in web services that require standardized communication
  and interoperability between different systems.  | 
 
No comments:
Post a Comment