partial response
A response that contains only the fields the client asked for, such as ?fields=id,title, which is a smaller representation of the same resource.
In more detail
The server must validate every field name, define what an empty choice means, and send Vary or a distinct cache key so caches do not mix shapes. Permission checks come first: selection must never reveal a field the caller may not see, and a small payload can still hide expensive work.
Example
GET /tasks?fields=id,titleRelated terms
- representation — The data sent to describe a resource’s state in one particular format, such as a JSON document for a task.
- Vary header — The response header that lists which request headers changed the answer, so caches keep separate copies for each value.
- N+1 query problem — A performance bug where code runs one query for a list and then one more query per item, so N items cost N+1 queries.
- authorization — Deciding whether an already identified caller may perform a particular action on a particular resource.
Taught in
- Partial Responses — Modern API Architecture: REST, GraphQL & gRPC