Bird
0
0

How can you use Link headers to help clients navigate a filtered list where some pages might be empty? Choose the best approach.

hard📝 Application Q9 of 15
Rest API - Pagination Patterns
How can you use Link headers to help clients navigate a filtered list where some pages might be empty? Choose the best approach.
AAlways include links to all pages regardless of content
BInclude only links to pages with data using rel="next" and rel="prev"
CUse rel="empty" for pages without data
DExclude Link headers entirely when pages are empty
Step-by-Step Solution
Solution:
  1. Step 1: Consider client navigation needs

    Clients should only follow links to pages that contain data to avoid empty results.
  2. Step 2: Evaluate options

    Including only valid next and previous pages helps clients navigate efficiently. rel="empty" is not a standard relation, and excluding Link headers removes navigation aid.
  3. Final Answer:

    Include only links to pages with data using rel="next" and rel="prev" -> Option B
  4. Quick Check:

    Link headers should guide to valid pages only [OK]
Quick Trick: Link only to pages with data to avoid empty navigation [OK]
Common Mistakes:
  • Linking to empty pages
  • Inventing non-standard rel values
  • Removing Link headers when pages are empty

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes