#api
Posts tagged with “api”.
18 posts
API Authentication Methods Compared
API keys, JWTs, OAuth and sessions each solve a different problem. Learn how they work, when to use each, and the common mistakes.
Designing API Error Responses That Help
A good error response tells the client what went wrong and what to do. Learn the status codes, the body shape, and the validation errors.
API Pagination Patterns: Offset, Cursor and Keyset
Offset, cursor and keyset pagination each trade simplicity for correctness. Learn the trade-offs and which to choose for a large dataset.
API Versioning Strategies Compared
URL, header and media-type versioning each break a client differently. Learn the trade-offs and how to make a change without a new version.
CORS Explained: Why Your Fetch Request Is Blocked
CORS is a browser rule, not a server one. Learn the preflight, the headers, the credentials, and how to fix the common errors.
curl: A Complete Practical Guide
curl is the tool for talking to an HTTP API from the terminal. Learn the flags for a request, a header, a body, a file and a debug trace.
FastAPI Request Bodies: Build a Small Local API
Create a local FastAPI endpoint with a Pydantic request model, try valid and invalid JSON, and separate validation from storage and permissions.
The Fetch API: A Practical Guide
fetch is the modern way to make an HTTP request in the browser. Learn the response handling, the errors, the abort, and the streaming.
GraphQL Basics: Schema, Queries and Resolvers
GraphQL lets the client ask for exactly what it needs. Learn the schema, the query, the resolver, and the N+1 problem in practice.
gRPC Explained: Protobuf, Streaming and When to Use It
gRPC is a binary RPC framework over HTTP/2. Learn the protobuf schema, the four call types, and when REST is the better choice.
Idempotency Keys: Making a Retry Safe
A retry can duplicate a payment. Learn the idempotency key, the storage, the race, and how the response is replayed.
Input Validation: A Practical Guide
Validate at the boundary, allowlist what is expected, and never trust the client. A practical guide to validating input safely.
JSON Schema: Validating JSON With a Schema
A JSON Schema describes the shape of a JSON document. Learn the types, the constraints, the composition, and the validation.
OAuth 2.0 Explained: Flows and When to Use Each
OAuth 2.0 lets an app access a user's data without their password. Learn the flows, the tokens, and the mistakes that cause vulnerabilities.
Rate Limiting Algorithms: Token Bucket to Sliding Window
A rate limit protects a service from abuse. Learn the algorithms, the headers, the distributed case, and the client behaviour.
Rate Limiting vs Throttling: What the Difference Is
Rate limiting rejects excess requests; throttling slows them down. Learn the difference, the algorithms, and how to respond well.
MCP vs APIs: When to Use Model Context Protocol vs Plain APIs
Model Context Protocol vs traditional APIs: when to use MCP, when to stick with REST APIs, and how to choose the right integration pattern for AI-powered applications.
Building a REST API with Rate Limiting
Add rate limiting to a Node.js REST API with Express: per-route limits, Redis stores, proxy headers, 429 responses, and real commands you can run.