APIs and REST Flashcards
7 cards from real Web Development practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 APIs and REST flashcards as text
What is the difference between REST and GraphQL regarding data fetching?
Answer: GraphQL lets clients specify exactly what data they need
GraphQL allows clients to request precisely the fields they need, eliminating over-fetching and under-fetching problems common in REST.
Which header is used to send a bearer token for API authentication?
Answer: Authorization: Bearer
The Authorization header with the 'Bearer' scheme is the standard way to pass JWT or OAuth tokens in HTTP requests.
What is API versioning primarily used for?
Answer: Allowing breaking changes without disrupting existing clients
API versioning lets you release breaking changes in a new version (e.g., /v2/) while existing clients continue using the old version without disruption.
In REST API design, what is 'over-fetching'?
Answer: Receiving more data than the client actually needs
Over-fetching occurs when an API endpoint returns more fields than the client needs, wasting bandwidth and processing time.
What does the 'Content-Negotiation' process do in HTTP?
Answer: Allows the client to request a preferred response format
Content negotiation lets clients specify preferred response formats (e.g., JSON or XML) via the Accept header, and the server responds accordingly.
Which of these is a correct practice for REST API pagination?
Answer: Use query parameters like ?page=2&limit=20 to control result sets
Query parameters such as page and limit (or offset and limit) are a common and RESTful way to implement pagination for large collections.
What is an idempotent HTTP method?
Answer: A method where multiple identical requests produce the same server state as one
Idempotency means that making the same request multiple times results in the same server state as making it once; GET, PUT, and DELETE are idempotent.
How this page was made: written with AI tools. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy