Bird
0
0

You have a REST API that stores user sessions on the server between requests. Which REST constraint is violated and how can you fix it?

medium📝 Debug Q14 of 15
Rest API - REST API Fundamentals
You have a REST API that stores user sessions on the server between requests. Which REST constraint is violated and how can you fix it?
AUniform Interface; change URL structure
BCacheability; disable caching on responses
CLayered System; remove intermediaries
DStatelessness; move session data to client or include in each request
Step-by-Step Solution
Solution:
  1. Step 1: Identify the violated constraint

    Storing session data on server between requests breaks statelessness because server keeps client state.
  2. Step 2: Suggest a fix to restore statelessness

    Move session info to client (like tokens) or send all needed info in each request.
  3. Final Answer:

    Statelessness; move session data to client or include in each request -> Option D
  4. Quick Check:

    Server session storage breaks statelessness [OK]
Quick Trick: No server session storage means statelessness [OK]
Common Mistakes:
  • Confusing cacheability with session storage
  • Thinking layered system relates to sessions
  • Trying to fix by changing URLs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes