AI & Artificial Intelligence
Explore AI foundations, generative models, agents, developer tools, and responsible use.
LinkSpot Knowledge
Explore AI foundations, generative models, agents, developer tools, and responsible use.
Learn programming fundamentals, languages, web and mobile development, databases, testing, and architecture.
Explore cloud platforms, Linux operations, containers, DevOps, and networking.
Learn practical web and network security, identity, privacy, and security operations.
Explore data engineering, SQL, analytics, visualization, and data quality.
Explore PCs, semiconductors, mobile devices, IoT, robotics, and open web standards.
Discover developer, collaboration, and design tools plus no-code and low-code workflows.
LinkSpot Knowledge
Explore practical guides and knowledge by category.
1,879 articles
When an API accepts a file or binary payload, send the original bytes as the request body and use the media type required by the endpoint. application/octet-stream is a general choice for arbitrary bytes; when the format is known, such as JPEG or PDF, use its specific media type.
A bearer token is a credential that lets whoever holds it access a protected resource without separate cryptographic proof. In OAuth 2.0 Bearer usage, clients usually send an access token in the Authorization: Bearer <access-token header. Because someone else can use a leaked token, send it over HTTPS, keep it out of URLs, and limit its privileges and intended audience.
A batch endpoint sends several subrequests in one outer HTTP request body. It can reduce network round trips, but the batch is not automatically one atomic operation and all items do not necessarily succeed together. The API must define per-request results, execution order, transaction boundaries, size limits, and error handling as separate parts of its contract.
A background job runs later or on a schedule, separately from a user request. A short in-process queue can be simple, but durable queues and separate workers are safer when work must survive restarts or absorb bursts. Design status tracking, duplicate handling, and recovery together.
Axum extractors run from left to right in function-argument order. A body-consuming extractor such as Json<T can read the request body only once, so it must be the final argument. This example uses Axum 0.8.9.
Authorization middleware decides on the server whether an already identified user may perform a particular action, and passes only permitted requests to the next handler. Using a document-editing API in Express 5, this article explains object-level permissions that role checks can miss, deny-by-default behavior, 401 and 403 responses, and middleware placement. Policy rules are injected by the service; the sample code has not been compiled or run.
Authentication middleware validates a request's credentials and, on success, makes verified user information available to later handlers. This article uses a Bearer-token API in Express 5 to explain the middleware boundary, placement, and error handling; token cryptography is delegated to a trusted authentication library. Authorization decisions about roles or resources and login-session management are separate concerns.
When an application cache stores authenticated responses, its key must reflect the access scope that can change the response. Two callers must not share a key when they can see different data, even if they request the same URL. A cache key does not replace authorization: check the caller's access before reading the cache.
At-least-once delivery retries messages to avoid losing them, while accepting that the same message may arrive more than once. A consumer processes a message and then acknowledges it; if a failure occurs before the acknowledgement, the broker may deliver it again. This does not mean a business effect happens exactly once: consumers must tolerate repeated work.
An AsyncAPI document is a machine-readable contract for a message-driven API: it describes the servers an application connects to, the channels it uses, the messages exchanged, and whether the documented application sends or receives them. This example documents a consumer receiving a signup event. It follows the current published AsyncAPI 3.1.0 specification; example host, topic, and fields are fictional.
When building an ASP.NET Core API, choose Minimal APIs or controllers first, then align service registrations and middleware order. Minimal APIs are a compact starting point for straightforward HTTP APIs; controllers can suit applications that rely on MVC features, complex organization, or established team conventions. Pipeline order and dependency-injection lifetimes affect behavior and tests.
ASGI (Asynchronous Server Gateway Interface) is the standard interface between asynchronous Python apps and protocol servers. The server provides a per-connection scope; the app receives events through receive and sends response events with send. An HTTP request has one scope per request, while a WebSocket scope lasts until the connection closes. This event model supports protocols that exchange multiple messages. This guide explains the ASGI 3 callable, HTTP/WebSocket events, and lifespan; it does not cover a framework API or server deployment.
API versioning is the policy for distinguishing and releasing changes so an API can evolve while keeping its contract with existing clients. Compatible changes, such as adding a response field, may fit within an existing version; changes that can break consumers, such as removing a field or changing its meaning, need a new version and a migration plan. There is no universally correct choice between path versioning (`/v2`) and header or query versioning, so choose based on consumers and operations, then plan how support will end.
Use the HTTP status to show the broad failure class and a stable machine-readable body with field-level information the client can correct. RFC 9457 Problem Details can provide a common outer format, with field errors as API-defined extensions; it is a standard option, not mandatory for every API.
The HTTP Sunset response header signals that the resource is expected to become unresponsive after a specific time. It is not meant merely to mark an API that is no longer recommended. Under RFC 8594, Sunset is a hint about expected unavailability; it does not guarantee which status code or behavior will occur on that date.
API sorting defines the order in which a collection is returned. OData uses $orderby, but REST APIs vary in the syntax they support. For paged lists or repeatable reads, state the sort explicitly and include a unique tie-breaker; do not let clients inject arbitrary database expressions.
An API schema is a machine-readable contract that describes the structure and constraints of data an API accepts or returns. For JSON APIs, JSON Schema can define an object's properties, types, required fields, and value limits; a validator checks whether a JSON instance follows those rules. Schema validation checks data shape. It does not guarantee authentication, business rules, or the server's overall behavior. This article uses JSON Schema Draft 2020-12 to define a product-creation request.
An API sandbox is an isolated environment for trying an integration without affecting real users or production transactions. Test accounts, credentials, and endpoints let you check requests, responses, and follow-up events. Do not assume a sandbox is identical to production: supported features, data, external connections, performance, and failure conditions can differ.
Pagination splits a large collection across multiple responses so a client can process a manageable portion and request the next page. API designers need to define ordering, behavior under concurrent changes, page size, and how clients continue; otherwise clients can miss or repeat records or request expensive pages.
API observability connects signals so you can explain where latency, errors, or traffic changes arise across a request path and its services—not merely whether a request succeeded. In OpenTelemetry, metrics reveal aggregate changes in service behavior, traces follow a request across services, and logs provide event detail. Correlating them with trace context and consistent route, status, and error attributes makes API incidents easier to narrow.