Bird
0
0

Given this response envelope JSON:

medium📝 Predict Output Q4 of 15
Rest API - Request and Response Format
Given this response envelope JSON:
{"status": "error", "message": "Invalid ID", "data": null}

What should a client do when it receives this response?
ARetry the request immediately
BIgnore the message and process data
CDisplay the error message to the user
DAssume the data is valid and continue
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the status field

    The status is 'error', indicating the request failed.
  2. Step 2: Determine client action

    The client should show the error message to inform the user about the problem.
  3. Final Answer:

    Display the error message to the user -> Option C
  4. Quick Check:

    Error status means show message [OK]
Quick Trick: Show error messages when status is error [OK]
Common Mistakes:
  • Ignoring error status
  • Retrying without fix
  • Assuming data is valid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes