REST APIs and REST Principles (1)
REST APIs and REST Principles (1)
RESTFUL APIS
ESTful APIs allow systems to communicate over HTTP using standard methods like
R
📦 Caching Mechanisms ☁️ Serverless Architecture
GET, POST, PUT, and DELETE, where resources are identified by URLs and data is
typically exchanged in JSON format.
● ache-Control:Rules for caching duration and access
C
● o server management — just write functions
N
● ETag:Unique identifier (hash) for resource version ● Pay only when functions are called
● If-Modified-Since:Client sends last fetch timestamp ● Event-driven: Triggers like API call, cron, file upload
✅ REST Methods & Status Codes ● Works together to minimize bandwidth and boost performance ● Platforms:AWS Lambda,Google Cloud Functions,AzureFunctions
● Use withAPI Gatewayfor REST endpoints
HTTP Methods:
● asic Auth:Username and password sent via HTTP headers
B
● erver pushes data to clientwhen an event occurs
S 🔀 API Gateway vs Service Mesh
● Bearer Token:Use JWT or OAuth tokens after login
● API Keys:Used in header for services like paymentgateways ● Common in payment gateways (e.g., Stripe, Razorpay)
● OAuth:Secure delegated access to third-party resources ● Ensure security via secret tokens, timestamp, hash verification Feature API Gateway Service Mesh
● ostman– Manual + automated testing
P Use Case uth, rate limits, request
A oad balancing, retries,
L
● sed to preventunauthorized cross-originrequests
U
● Insomnia– Lightweight API tester routing observability
● Can configure allowed origins, methods, headers
● Helps protect APIs from unwanted external access ● Hopscotch– Web-based API testing
● Newman– CLI tool to run Postman tests Examples Kong, AWS API Gateway Istio, Linkerd, Consul Connect
● Jest/Supertest– Test APIs in Node.js