Bird
0
0

Given a REST API server that does not store client session data, what will be the output if a client sends two requests: first with valid credentials, second without any credentials?

medium📝 Predict Output Q4 of 15
Rest API - REST API Fundamentals
Given a REST API server that does not store client session data, what will be the output if a client sends two requests: first with valid credentials, second without any credentials?
AFirst request succeeds; second request fails with unauthorized error
BBoth requests succeed because server remembers first login
CBoth requests fail due to missing session data
DSecond request succeeds because server caches credentials
Step-by-Step Solution
Solution:
  1. Step 1: Understand stateless server behavior

    Server does not remember previous requests or sessions.
  2. Step 2: Analyze requests with and without credentials

    First request with credentials succeeds; second without fails due to missing auth.
  3. Final Answer:

    First request succeeds; second request fails with unauthorized error -> Option A
  4. Quick Check:

    Stateless server requires auth each request [OK]
Quick Trick: Each request must authenticate independently [OK]
Common Mistakes:
  • Assuming server remembers login
  • Thinking missing credentials still allow access
  • Believing server caches credentials

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes