FlashKeepers

Web Development · College · College and University

REST API Design

REST constraints, resources, HTTP methods, idempotency, status codes, pagination, versioning, HATEOAS and OpenAPI.

About this set

42 basic cards for College Web Development. It opens with "What are the six constraints of REST architecture?" and "Explain the Client-Server constraint of REST". Study it alongside the other College sets below.

42 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What are the six constraints of REST architecture?
Show answerClient-Server, Statelessness, Uniform Interface, Cacheability, Layered System, Code on Demand
Explain the Client-Server constraint of REST.
Show answerSeparates clients and servers so each can evolve independently without tight coupling
What does the Statelessness constraint require?
Show answerEach request must contain all information needed to process it; the server stores no client context
Explain the Uniform Interface constraint in REST.
Show answerStandardized communication through consistent resource identification, manipulation via HTTP methods, and self-descriptive messages
What is the purpose of the Cacheability constraint?
Show answerResponses must define themselves as cacheable or not-cacheable to improve performance and reduce server load
Explain the Layered System constraint.
Show answerClients cannot tell if directly connected to the end server; systems organized in layers interact only with adjacent layers
What is the Code on Demand constraint?
Show answerServers can optionally extend client functionality by transferring executable code (rarely used in modern APIs)
What is a resource in REST API design?
Show answerAn entity or object identified by a unique URI that can be accessed and manipulated using HTTP methods
How should resource URIs be structured in REST APIs?
Show answerUse nouns instead of verbs, lowercase letters, hyphens to separate words, and hierarchical paths for relationships
Should you use verbs or nouns in REST resource URLs?
Show answerNouns; HTTP methods provide the verbs so URLs should identify the resource being acted upon
How should you represent a one-to-many relationship in a REST URL?
Show answerUse hierarchical paths like /users/123/posts to show posts belonging to user 123
What naming convention should REST resource URLs follow?
Show answerUse plural nouns in lowercase with hyphens: /api/users, /api/blog-posts (not /user or /BlogPosts)
What HTTP method retrieves a resource without modifying it?
Show answerGET
What HTTP method creates a new resource?
Show answerPOST
What HTTP method replaces an entire existing resource?
Show answerPUT

27 more cards in the app

Study this set free