APIs: REST, GraphQL & HTTP Status Codes
108 cards · 🇺🇸 English
REST and GraphQL API concepts plus common HTTP status codes.
Study all 108 cards for free
Flashcards, quizzes, pixel-art games and a daily review that remembers for you.
Try the first 10 cards
1 / 10REST
Tap the card for the answer · swipe right if you knew it, left if not
Already have an account? Sign in
Cards
- 1RESTREpresentational State Transfer - an architectural style for distributed systems using stateless, client-server communication with uniform interfaces and resource-based URIs.
- 26 REST constraints1) Uniform Interface, 2) Client-Server, 3) Stateless, 4) Cacheable, 5) Layered System, 6) Code-on-Demand (optional).
- 3Uniform interface constraintResources identified by URIs, manipulation through representations, self-descriptive messages, and hypermedia as the engine of application state (HATEOAS).
- 4StatelessEach request contains all information needed to understand and process it. Server doesn't store client session state between requests.
- 5Resource in RESTAny information that can be named - a document, image, collection, non-virtual object. Resources are identified by URIs and manipulated via representations.
- 6Resource representationThe state of a resource at a given time, including data, metadata, and hypermedia links. Common formats: JSON, XML, HTML.
- 7What HTTP method is used for retrieving resources?GET - retrieves a resource without side effects. Idempotent and safe (doesn't modify server state).
- 8What HTTP method is used for creating resources?POST - creates a new resource. Server determines URI. Not idempotent (multiple calls create multiple resources).
- 9What HTTP method is used for updating resources?PUT - replaces entire resource or creates if doesn't exist. Idempotent (same request multiple times has same effect).
- 10What HTTP method is used for partial updates?PATCH - applies partial modifications to a resource. Updates specific fields without replacing the entire resource.
- 11What HTTP method is used for deleting resources?DELETE - removes a resource. Idempotent (deleting same resource multiple times has same effect).
- 12IdempotentAn operation is idempotent if performing it multiple times has the same effect as performing it once. GET, PUT, DELETE are idempotent; POST is not.
- 13SafeA safe method doesn't modify server state. Only retrieves information. GET, HEAD, OPTIONS are safe.
- 14What HTTP status code indicates success?200 OK - successful GET, PUT, PATCH. 201 Created - successful POST. 204 No Content - successful DELETE.
- 15400 Bad RequestClient error - malformed request syntax, invalid parameters, or missing required fields.
- 16401 UnauthorizedAuthentication is required. Client must provide valid credentials. Misleading name - actually means unauthenticated.
- 17403 ForbiddenClient is authenticated but doesn't have permission to access the resource. Authorization failed.
- 18404 Not FoundRequested resource doesn't exist. Server can't find the URI.
- 19500 Internal Server ErrorServer encountered an unexpected condition. Generic server-side error message.
- 20503 Service UnavailableServer temporarily unable to handle request (overload, maintenance). Includes Retry-After header when possible.
- 21HATEOASHypermedia As The Engine Of Application State - responses include hypermedia links to related resources and possible actions, making API self-descriptive.
- 22API endpointA specific URI where an API resource or collection can be accessed. Example: /api/users, /api/users/123.
- 23How should collections be named in REST?Use plural nouns: /users, /products, /orders. Be consistent. Avoid verbs - use HTTP methods instead.
- 24How should single resources be addressed?Use resource ID after collection: /users/123, /products/abc. ID can be numeric or string (UUID).
- 25How should nested resources be structured?Reflect relationships: /users/123/posts, /orders/456/items. Keep nesting shallow (max 2-3 levels).
- 26Query parameters used forFiltering, sorting, pagination, searching. Example: /users?role=admin&sort=name&page=2&limit=20.
- 27How should pagination be implemented?Query params: ?page=2&limit=20 or ?offset=40&limit=20. Include total count and links (next, prev) in response.
- 28API versioningManaging breaking changes by maintaining multiple API versions. Methods: URI (/v1/users), header (Accept: application/vnd.api+json;version=1), subdomain (api-v1.example.com).
- 29Content NegotiationClient specifies desired format via Accept header. Server responds with Content-Type. Example: Accept: application/json.
- 30What headers are commonly used in REST APIs?Authorization, Content-Type, Accept, Cache-Control, ETag, If-None-Match, If-Modified-Since, Location (for redirects).
And 78 more cards. Study the whole deck free
Articles about this deck
More Programming decks
See all- 🎨
CSS: Box-Modell, Selektoren & Media Queries
129 cards · 🇺🇸 English
Das CSS-Box-Modell, Selektortypen, Media Queries und Animationen.
- 📄
HTML : balises et attributs
99 cards · 🇺🇸 English
Éléments HTML essentiels et leurs attributs.
- 🎨
CSS: Box Model, Selectors & Media Queries
129 cards · 🇺🇸 English
The CSS box model, selector types, media queries, and animations.
- 🔒
Web Security: OWASP & Authentication
35 cards · 🇺🇸 English
Common web vulnerabilities (OWASP Top 10) and authentication concepts.
- 🎨
CSS : Flexbox et Grid
58 cards · 🇺🇸 English
Mise en page avec CSS Flexbox et Grid.
- 🔷
TypeScript: Types, Interfaces & Generics
77 cards · 🇺🇸 English
Core TypeScript type system: types, interfaces, and generics.
