Bird
0
0

What will the client receive when it sends a GET request to that URL if the job is still running?

medium📝 Predict Output Q5 of 15
Rest API - Advanced Patterns
A client sends a request to start a long-running operation. The server responds with status 202 and a Location header set to "/jobs/789/status". What will the client receive when it sends a GET request to that URL if the job is still running?
A404 Not Found
B{"status": "running", "progress": 50}
C{"error": "Job not found"}
D500 Internal Server Error
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of the status URL

    The status URL lets the client check the current state of the job.
  2. Step 2: Identify expected response when job is running

    The server should return a JSON indicating the job is running and its progress.
  3. Final Answer:

    {"status": "running", "progress": 50} -> Option B
  4. Quick Check:

    Running job status = JSON with status running [OK]
Quick Trick: Status URL returns JSON with current job state [OK]
Common Mistakes:
MISTAKES
  • Expecting 404 if job is running
  • Confusing error JSON with normal status
  • Assuming server error for running job

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes