Bird
Raised Fist0

Given this API response:

medium📝 Predict Output Q4 of Q15
Rest API - HATEOAS and Linking
Given this API response:
{"data": {"id": 7, "title": "Movie"}, "links": {"next": "https://api.example.com/movies/8"}}

Which URL should the client request next?
Ahttps://api.example.com/movies/6
Bhttps://api.example.com/movies/7
Chttps://api.example.com/movies/8
Dhttps://api.example.com/movies
Step-by-Step Solution
Solution:
  1. Step 1: Locate 'next' link

    The 'next' key in the links object indicates the next resource URL.
  2. Step 2: Identify URL value

    The value is "https://api.example.com/movies/8" which the client should follow.
  3. Final Answer:

    https://api.example.com/movies/8 -> Option C
  4. Quick Check:

    Follow the 'next' link URL exactly [OK]
Quick Trick: Follow the 'next' link URL in response [OK]
Common Mistakes:
MISTAKES
  • Choosing current or previous resource URLs
  • Ignoring the 'next' link
  • Assuming default URLs without checking links

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes