Types of API Flashcards
REST
REST (Representational State Transfer) is an API style using stateless, client-server communication, typically over HTTP. It manipulates resources via standard methods (GET, POST, PUT, DELETE).
Example - A REST API for a bookstore might use /books (GET to view books) and /books/{id} (POST to add a book).
SOAP
SOAP (Simple Object Access Protocol) is a protocol for structured information exchange in web services, using XML over HTTP or SMTP.
Example - A SOAP API for weather might send XML requests to get temperature or humidity, with strict message format.
RPC
RPC (Remote Procedure Call) is a protocol where a program requests a service or function execution on a remote server as if it were local.
Example - An RPC call might ask a remote server to perform calculations or retrieve data by calling getUserData() with parameters
Local
A Local API provides communication between software components within the same system or device, without needing a network.
Example - An operating system API, like Windows API, allows applications to interact directly with system functions on the same machine.