HTTP
HTTP idempotency
A protocol-level concept: bound list results and preserve intended effects across identical idempotent requests. Local Node 22.16.0; production target compatibility pending. See https://www.rfc-editor.org/rfc/rfc9110.html.
Formal Syntax & Structure
nodejs syntaxnodejs
GET /catalog?offset=0&limit=20; PUT /catalog/1Return Value
Not applicable (protocol concept)
Property value or protocol concept, not a function return.
Working Example
Example Snippetnodejs
const items=[{id:3},{id:1},{id:4},{id:2}];const sorted=[...items].sort((a,b)=>a.id-b.id);const offset=2,limit=2;console.log(JSON.stringify(sorted.slice(offset,offset+limit).map(x=>x.id)));